Class ImmutableTrees.StringLiteral
- java.lang.Object
-
- org.immutables.generator.processor.Trees.StringLiteral
-
- org.immutables.generator.processor.ImmutableTrees.StringLiteral
-
- All Implemented Interfaces:
Trees.Expression
- Enclosing class:
- ImmutableTrees
@Immutable public static final class ImmutableTrees.StringLiteral extends Trees.StringLiteral
Immutable implementation ofTrees.StringLiteral.Use the static factory method to create immutable instances:
ImmutableTrees.StringLiteral.of().
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Stringvalue
-
Constructor Summary
Constructors Modifier Constructor Description privateStringLiteral(java.lang.String value)privateStringLiteral(ImmutableTrees.StringLiteral original, java.lang.String value)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableTrees.StringLiteralcopyOf(Trees.StringLiteral instance)Creates an immutable copy of aTrees.StringLiteralvalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofStringLiteralthat have equal attribute values.private booleanequalTo(int synthetic, ImmutableTrees.StringLiteral another)inthashCode()Computes a hash code from attributes:value.static ImmutableTrees.StringLiteralof(java.lang.String value)Construct a new immutableStringLiteralinstance.java.lang.Stringvalue()ImmutableTrees.StringLiteralwithValue(java.lang.String value)Copy the current immutable object by setting a value for thevalueattribute.-
Methods inherited from class org.immutables.generator.processor.Trees.StringLiteral
toString
-
-
-
-
Constructor Detail
-
StringLiteral
private StringLiteral(java.lang.String value)
-
StringLiteral
private StringLiteral(ImmutableTrees.StringLiteral original, java.lang.String value)
-
-
Method Detail
-
value
public java.lang.String value()
- Specified by:
valuein classTrees.StringLiteral- Returns:
- The value of the
valueattribute
-
withValue
public final ImmutableTrees.StringLiteral 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 ofStringLiteralthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
equalTo
private boolean equalTo(int synthetic, ImmutableTrees.StringLiteral another)
-
hashCode
public int hashCode()
Computes a hash code from attributes:value.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
of
public static ImmutableTrees.StringLiteral of(java.lang.String value)
Construct a new immutableStringLiteralinstance.- Parameters:
value- The value for thevalueattribute- Returns:
- An immutable StringLiteral instance
-
copyOf
public static ImmutableTrees.StringLiteral copyOf(Trees.StringLiteral instance)
Creates an immutable copy of aTrees.StringLiteralvalue. 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 StringLiteral instance
-
-