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