/
Common Groovy Methods
Common Groovy Methods
Collection:
initialization = []
shift << operator
the in operator
initialization = [:]
index[“operator”]
dot.operator
Closure c1 = { it }
Closure c2 = { multiple, parameters -> ... }
Closure c3 = { return statementIsOptional }
assert a.foo({ bar(it) }) == a.foo { bar it }
assert null == false
assert 0 == false
assert “” == false
assert [] == false
assert new Object() == true
assert 123 == true
assert “Hello” == true
assert [1, 2, 3] == true
GString g = “Double quoted interpolated ${strings}”
String s = ‘single quotes strings’
def keyword closure { it }
*spreadOperator
safe?.navigation?.operator
the as Operator
BigDecimal type
, multiple selections available,
Related content
Groovy vs. Java
Groovy vs. Java
More like this
Groovy Basics
Groovy Basics
Read with this
Using Strings as Keys in Hash Maps
Using Strings as Keys in Hash Maps
More like this
Project Initialization
Project Initialization
Read with this
Iterating Collections
Iterating Collections
More like this
Deployment
Deployment
Read with this
Found an issue in documentation? Write to us.