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 implementation of
Trees.TextFragment.
Use the static factory method to create immutable instances:
ImmutableTrees.TextFragment.of().
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateTextFragment(String value) privateTextFragment(ImmutableTrees.TextFragment original, String value) -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableTrees.TextFragmentcopyOf(Trees.TextFragment instance) Creates an immutable copy of aTrees.TextFragmentvalue.booleanThis 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.TextFragmentConstruct a new immutableTextFragmentinstance.value()Copy the current immutable object by setting a value for thevalueattribute.Methods inherited from class org.immutables.generator.processor.Trees.TextFragment
isWhitespace, toString
-
Field Details
-
value
-
-
Constructor Details
-
TextFragment
-
TextFragment
-
-
Method Details
-
value
- Specified by:
valuein classTrees.TextFragment- Returns:
- The value of the
valueattribute
-
withValue
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
This instance is equal to all instances ofTextFragmentthat have equal attribute values. -
equalTo
-
hashCode
public int hashCode()Computes a hash code from attributes:value. -
of
Construct a new immutableTextFragmentinstance.- Parameters:
value- The value for thevalueattribute- Returns:
- An immutable TextFragment instance
-
copyOf
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
-