public class LambdaExpression
extends ClosureExpression
Represents a lambda expression such as one of these:
e -> e * 2
(x, y) -> x + y
(x, y) -> { x + y }
(int x, int y) -> { x + y }
| Fields inherited from class | Fields |
|---|---|
class Expression |
EMPTY_ARRAY |
| Constructor and description |
|---|
LambdaExpression(Parameter[] parameters, Statement code)Creates a lambda with the given parameters and body. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public String |
getText() |
|
public boolean |
isSerializable()Whether code generation should treat this lambda as serializable. |
|
public void |
setSerializable(boolean serializable)Records whether the generated lambda class should be serializable. |
|
public void |
visit(GroovyCodeVisitor visitor) |
| Methods inherited from class | Name |
|---|---|
class ClosureExpression |
getCode, getParameters, getText, getVariableScope, isParameterSpecified, setCode, setVariableScope, toString, transformExpression, visit |
class Expression |
getType, setType, transformExpression, transformExpressions, transformExpressions |
class AnnotatedNode |
addAnnotation, addAnnotation, addAnnotations, getAnnotations, getAnnotations, getDeclaringClass, getGroovydoc, getInstance, hasNoRealSourcePosition, isSynthetic, setDeclaringClass, setHasNoRealSourcePosition, setSynthetic |
class ASTNode |
copyNodeMetaData, getColumnNumber, getLastColumnNumber, getLastLineNumber, getLineNumber, getMetaDataMap, getText, setColumnNumber, setLastColumnNumber, setLastLineNumber, setLineNumber, setMetaDataMap, setSourcePosition, visit |
Whether code generation should treat this lambda as serializable.
When set, the generated class receives a serialVersionUID and
deserialization support. The type checker sets this when a target type
implements Serializable.
true when the lambda is marked serializableRecords whether the generated lambda class should be serializable.
serializable - true to emit serialization supportCopyright © 2003-2026 The Apache Software Foundation. All rights reserved.