Class ImmutableTrees.AssignGenerator
- java.lang.Object
-
- org.immutables.generator.processor.ImmutableTrees.AssignGenerator
-
- All Implemented Interfaces:
Trees.AssignGenerator,Trees.GeneratorDeclaration,Trees.GeneratorValueDeclaration
- Enclosing class:
- ImmutableTrees
@Immutable public static final class ImmutableTrees.AssignGenerator extends java.lang.Object implements Trees.AssignGenerator
Immutable implementation ofTrees.AssignGenerator.Use the builder to create immutable instances:
ImmutableTrees.AssignGenerator.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableTrees.AssignGenerator.BuilderBuilds instances of typeAssignGenerator.
-
Field Summary
Fields Modifier and Type Field Description private Trees.ValueDeclarationdeclarationprivate Trees.Expressionfrom
-
Constructor Summary
Constructors Modifier Constructor Description privateAssignGenerator(Trees.ValueDeclaration declaration, Trees.Expression from)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableTrees.AssignGenerator.Builderbuilder()Creates a builder forAssignGenerator.static ImmutableTrees.AssignGeneratorcopyOf(Trees.AssignGenerator instance)Creates an immutable copy of aTrees.AssignGeneratorvalue.Trees.ValueDeclarationdeclaration()booleanequals(java.lang.Object another)This instance is equal to all instances ofAssignGeneratorthat have equal attribute values.private booleanequalTo(int synthetic, ImmutableTrees.AssignGenerator another)Trees.Expressionfrom()inthashCode()Computes a hash code from attributes:declaration,from.java.lang.StringtoString()Prints the immutable valueAssignGeneratorwith attribute values.ImmutableTrees.AssignGeneratorwithDeclaration(Trees.ValueDeclaration value)Copy the current immutable object by setting a value for thedeclarationattribute.ImmutableTrees.AssignGeneratorwithFrom(Trees.Expression value)Copy the current immutable object by setting a value for thefromattribute.
-
-
-
Field Detail
-
declaration
private final Trees.ValueDeclaration declaration
-
from
private final Trees.Expression from
-
-
Constructor Detail
-
AssignGenerator
private AssignGenerator(Trees.ValueDeclaration declaration, Trees.Expression from)
-
-
Method Detail
-
declaration
public Trees.ValueDeclaration declaration()
- Specified by:
declarationin interfaceTrees.GeneratorValueDeclaration- Returns:
- The value of the
declarationattribute
-
from
public Trees.Expression from()
- Specified by:
fromin interfaceTrees.GeneratorValueDeclaration- Returns:
- The value of the
fromattribute
-
withDeclaration
public final ImmutableTrees.AssignGenerator withDeclaration(Trees.ValueDeclaration value)
Copy the current immutable object by setting a value for thedeclarationattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for declaration- Returns:
- A modified copy of the
thisobject
-
withFrom
public final ImmutableTrees.AssignGenerator withFrom(Trees.Expression value)
Copy the current immutable object by setting a value for thefromattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for from- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(@Nullable java.lang.Object another)This instance is equal to all instances ofAssignGeneratorthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
equalTo
private boolean equalTo(int synthetic, ImmutableTrees.AssignGenerator another)
-
hashCode
public int hashCode()
Computes a hash code from attributes:declaration,from.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueAssignGeneratorwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
copyOf
public static ImmutableTrees.AssignGenerator copyOf(Trees.AssignGenerator instance)
Creates an immutable copy of aTrees.AssignGeneratorvalue. 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 AssignGenerator instance
-
builder
public static ImmutableTrees.AssignGenerator.Builder builder()
Creates a builder forAssignGenerator.ImmutableTrees.AssignGenerator.builder() .declaration(org.immutables.generator.processor.Trees.ValueDeclaration) // requireddeclaration.from(org.immutables.generator.processor.Trees.Expression) // requiredfrom.build();- Returns:
- A new AssignGenerator builder
-
-