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 public static final class ImmutableTrees.Invoke extends java.lang.Object implements Trees.Invoke
Immutable implementation ofTrees.Invoke.Use the builder to create immutable instances:
ImmutableTrees.Invoke.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableTrees.Invoke.BuilderBuilds instances of typeInvoke.
-
Field Summary
Fields Modifier and Type Field Description private Trees.AccessExpressionaccessprivate com.google.common.base.Optional<Trees.ApplyExpression>invoke
-
Constructor Summary
Constructors Modifier Constructor Description privateInvoke(Trees.AccessExpression access, com.google.common.base.Optional<Trees.ApplyExpression> invoke)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Trees.AccessExpressionaccess()static ImmutableTrees.Invoke.Builderbuilder()Creates a builder forInvoke.static ImmutableTrees.InvokecopyOf(Trees.Invoke instance)Creates an immutable copy of aTrees.Invokevalue.booleanequals(java.lang.Object another)This 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()java.lang.StringtoString()Prints the immutable valueInvokewith attribute values.ImmutableTrees.InvokewithAccess(Trees.AccessExpression value)Copy the current immutable object by setting a value for theaccessattribute.ImmutableTrees.InvokewithInvoke(com.google.common.base.Optional<? extends Trees.ApplyExpression> optional)Copy the current immutable object by setting an optional value for theinvokeattribute.ImmutableTrees.InvokewithInvoke(Trees.ApplyExpression value)Copy the current immutable object by setting a present value for the optionalinvokeattribute.
-
-
-
Field Detail
-
access
private final Trees.AccessExpression access
-
invoke
private final com.google.common.base.Optional<Trees.ApplyExpression> invoke
-
-
Constructor Detail
-
Invoke
private Invoke(Trees.AccessExpression access, com.google.common.base.Optional<Trees.ApplyExpression> invoke)
-
-
Method Detail
-
access
public Trees.AccessExpression access()
- Specified by:
accessin interfaceTrees.InvokeDeclaration- Returns:
- The value of the
accessattribute
-
invoke
public com.google.common.base.Optional<Trees.ApplyExpression> invoke()
- Specified by:
invokein interfaceTrees.InvokeDeclaration- Returns:
- The value of the
invokeattribute
-
withAccess
public final ImmutableTrees.Invoke withAccess(Trees.AccessExpression value)
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
public final ImmutableTrees.Invoke withInvoke(Trees.ApplyExpression value)
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
public boolean equals(@Nullable java.lang.Object another)This instance is equal to all instances ofInvokethat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
equalTo
private boolean equalTo(int synthetic, ImmutableTrees.Invoke another)
-
hashCode
public int hashCode()
Computes a hash code from attributes:access,invoke.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueInvokewith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
copyOf
public static ImmutableTrees.Invoke copyOf(Trees.Invoke instance)
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
public static ImmutableTrees.Invoke.Builder 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
-
-