Class ImmutableTrees.Invoke
java.lang.Object
org.immutables.generator.processor.ImmutableTrees.Invoke
- All Implemented Interfaces:
Trees.Directive,Trees.DirectiveStart,Trees.Invoke,Trees.InvokeDeclaration,Trees.TemplatePart
- Enclosing class:
ImmutableTrees
Immutable implementation of
Trees.Invoke.
Use the builder to create immutable instances:
ImmutableTrees.Invoke.builder().
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Trees.AccessExpressionprivate final com.google.common.base.Optional<Trees.ApplyExpression> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateInvoke(Trees.AccessExpression access, com.google.common.base.Optional<Trees.ApplyExpression> invoke) -
Method Summary
Modifier and TypeMethodDescriptionaccess()builder()Creates a builder forInvoke.static ImmutableTrees.InvokecopyOf(Trees.Invoke instance) Creates an immutable copy of aTrees.Invokevalue.booleanThis instance is equal to all instances ofInvokethat have equal attribute values.private booleanequalTo(int synthetic, ImmutableTrees.Invoke another) inthashCode()Computes a hash code from attributes:access,invoke.com.google.common.base.Optional<Trees.ApplyExpression> invoke()toString()Prints the immutable valueInvokewith attribute values.final ImmutableTrees.InvokewithAccess(Trees.AccessExpression value) Copy the current immutable object by setting a value for theaccessattribute.final ImmutableTrees.InvokewithInvoke(com.google.common.base.Optional<? extends Trees.ApplyExpression> optional) Copy the current immutable object by setting an optional value for theinvokeattribute.final ImmutableTrees.InvokewithInvoke(Trees.ApplyExpression value) Copy the current immutable object by setting a present value for the optionalinvokeattribute.
-
Field Details
-
access
-
invoke
-
-
Constructor Details
-
Invoke
private Invoke(Trees.AccessExpression access, com.google.common.base.Optional<Trees.ApplyExpression> invoke)
-
-
Method Details
-
access
- Specified by:
accessin interfaceTrees.InvokeDeclaration- Returns:
- The value of the
accessattribute
-
invoke
- Specified by:
invokein interfaceTrees.InvokeDeclaration- Returns:
- The value of the
invokeattribute
-
withAccess
Copy the current immutable object by setting a value for theaccessattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for access- Returns:
- A modified copy of the
thisobject
-
withInvoke
Copy the current immutable object by setting a present value for the optionalinvokeattribute.- Parameters:
value- The value for invoke- Returns:
- A modified copy of
thisobject
-
withInvoke
public final ImmutableTrees.Invoke withInvoke(com.google.common.base.Optional<? extends Trees.ApplyExpression> optional) Copy the current immutable object by setting an optional value for theinvokeattribute. A shallow reference equality check on the optional value is used to prevent copying of the same value by returningthis.- Parameters:
optional- A value for invoke- Returns:
- A modified copy of
thisobject
-
equals
This instance is equal to all instances ofInvokethat have equal attribute values. -
equalTo
-
hashCode
public int hashCode()Computes a hash code from attributes:access,invoke. -
toString
Prints the immutable valueInvokewith attribute values. -
copyOf
Creates an immutable copy of aTrees.Invokevalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable Invoke instance
-
builder
Creates a builder forInvoke.ImmutableTrees.Invoke.builder() .access(org.immutables.generator.processor.Trees.AccessExpression) // requiredaccess.invoke(org.immutables.generator.processor.Trees.ApplyExpression) // optionalinvoke.build();- Returns:
- A new Invoke builder
-