Class ImmutableTrees.Identifier
- java.lang.Object
-
- org.immutables.generator.processor.Trees.Identifier
-
- org.immutables.generator.processor.ImmutableTrees.Identifier
-
- Enclosing class:
- ImmutableTrees
@Immutable public static final class ImmutableTrees.Identifier extends Trees.Identifier
Immutable implementation ofTrees.Identifier.Use the static factory method to create immutable instances:
ImmutableTrees.Identifier.of().
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Stringvalue
-
Constructor Summary
Constructors Modifier Constructor Description privateIdentifier(java.lang.String value)privateIdentifier(ImmutableTrees.Identifier original, java.lang.String value)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableTrees.IdentifiercopyOf(Trees.Identifier instance)Creates an immutable copy of aTrees.Identifiervalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofIdentifierthat have equal attribute values.private booleanequalTo(int synthetic, ImmutableTrees.Identifier another)inthashCode()Computes a hash code from attributes:value.static ImmutableTrees.Identifierof(java.lang.String value)Construct a new immutableIdentifierinstance.java.lang.Stringvalue()ImmutableTrees.IdentifierwithValue(java.lang.String value)Copy the current immutable object by setting a value for thevalueattribute.-
Methods inherited from class org.immutables.generator.processor.Trees.Identifier
toString
-
-
-
-
Constructor Detail
-
Identifier
private Identifier(java.lang.String value)
-
Identifier
private Identifier(ImmutableTrees.Identifier original, java.lang.String value)
-
-
Method Detail
-
value
public java.lang.String value()
- Specified by:
valuein classTrees.Identifier- Returns:
- The value of the
valueattribute
-
withValue
public final ImmutableTrees.Identifier withValue(java.lang.String value)
Copy the current immutable object by setting a value for thevalueattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for value- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(@Nullable java.lang.Object another)This instance is equal to all instances ofIdentifierthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
equalTo
private boolean equalTo(int synthetic, ImmutableTrees.Identifier another)
-
hashCode
public int hashCode()
Computes a hash code from attributes:value.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
of
public static ImmutableTrees.Identifier of(java.lang.String value)
Construct a new immutableIdentifierinstance.- Parameters:
value- The value for thevalueattribute- Returns:
- An immutable Identifier instance
-
copyOf
public static ImmutableTrees.Identifier copyOf(Trees.Identifier instance)
Creates an immutable copy of aTrees.Identifiervalue. 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 Identifier instance
-
-