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 public static final class ImmutableTrees.TextLine extends Trees.TextLine
Immutable implementation ofTrees.TextLine.Use the builder to create immutable instances:
ImmutableTrees.TextLine.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableTrees.TextLine.BuilderBuilds instances of typeTextLine.
-
Field Summary
Fields Modifier and Type Field Description private Trees.TextFragmentfragmentprivate booleannewline
-
Constructor Summary
Constructors Modifier Constructor Description privateTextLine(ImmutableTrees.TextLine.Builder builder)privateTextLine(Trees.TextFragment fragment, boolean newline)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableTrees.TextLine.Builderbuilder()Creates a builder forTextLine.static ImmutableTrees.TextLinecopyOf(Trees.TextLine instance)Creates an immutable copy of aTrees.TextLinevalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofTextLinethat have equal attribute values.private booleanequalTo(int synthetic, ImmutableTrees.TextLine another)Trees.TextFragmentfragment()inthashCode()Computes a hash code from attributes:fragment,newline.booleannewline()ImmutableTrees.TextLinewithFragment(Trees.TextFragment value)Copy the current immutable object by setting a value for thefragmentattribute.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 Detail
-
fragment
private final Trees.TextFragment fragment
-
newline
private final boolean newline
-
-
Constructor Detail
-
TextLine
private TextLine(ImmutableTrees.TextLine.Builder builder)
-
TextLine
private TextLine(Trees.TextFragment fragment, boolean newline)
-
-
Method Detail
-
fragment
public Trees.TextFragment 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
public final ImmutableTrees.TextLine withFragment(Trees.TextFragment value)
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
public final ImmutableTrees.TextLine withNewline(boolean value)
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
public boolean equals(@Nullable java.lang.Object another)This instance is equal to all instances ofTextLinethat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
equalTo
private boolean equalTo(int synthetic, ImmutableTrees.TextLine another)
-
hashCode
public int hashCode()
Computes a hash code from attributes:fragment,newline.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
copyOf
public static ImmutableTrees.TextLine copyOf(Trees.TextLine instance)
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
public static ImmutableTrees.TextLine.Builder 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
-
-