Class ImmutableTrees.TextLine
java.lang.Object
org.immutables.generator.processor.Trees.TextLine
org.immutables.generator.processor.ImmutableTrees.TextLine
- All Implemented Interfaces:
Trees.Synthetic,Trees.TemplatePart
- Enclosing class:
ImmutableTrees
Immutable implementation of
Trees.TextLine.
Use the builder to create immutable instances:
ImmutableTrees.TextLine.builder().
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateTextLine(ImmutableTrees.TextLine.Builder builder) privateTextLine(Trees.TextFragment fragment, boolean newline) -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder forTextLine.static ImmutableTrees.TextLinecopyOf(Trees.TextLine instance) Creates an immutable copy of aTrees.TextLinevalue.booleanThis instance is equal to all instances ofTextLinethat have equal attribute values.private booleanequalTo(int synthetic, ImmutableTrees.TextLine another) fragment()inthashCode()Computes a hash code from attributes:fragment,newline.booleannewline()final ImmutableTrees.TextLinewithFragment(Trees.TextFragment value) Copy the current immutable object by setting a value for thefragmentattribute.final ImmutableTrees.TextLinewithNewline(boolean value) Copy the current immutable object by setting a value for thenewlineattribute.Methods inherited from class org.immutables.generator.processor.Trees.TextLine
isBlank, isEmpty, toString
-
Field Details
-
fragment
-
newline
private final boolean newline
-
-
Constructor Details
-
TextLine
-
TextLine
-
-
Method Details
-
fragment
- Specified by:
fragmentin classTrees.TextLine- Returns:
- The value of the
fragmentattribute
-
newline
public boolean newline()- Overrides:
newlinein classTrees.TextLine- Returns:
- The value of the
newlineattribute
-
withFragment
Copy the current immutable object by setting a value for thefragmentattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for fragment- Returns:
- A modified copy of the
thisobject
-
withNewline
Copy the current immutable object by setting a value for thenewlineattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for newline- Returns:
- A modified copy of the
thisobject
-
equals
This instance is equal to all instances ofTextLinethat have equal attribute values. -
equalTo
-
hashCode
public int hashCode()Computes a hash code from attributes:fragment,newline. -
copyOf
Creates an immutable copy of aTrees.TextLinevalue. 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 TextLine instance
-
builder
Creates a builder forTextLine.ImmutableTrees.TextLine.builder() .fragment(org.immutables.generator.processor.Trees.TextFragment) // requiredfragment.newline(boolean) // optionalnewline.build();- Returns:
- A new TextLine builder
-