Class ImmutableTrees.TextBlock
- java.lang.Object
-
- org.immutables.generator.processor.ImmutableTrees.TextBlock
-
- All Implemented Interfaces:
Trees.TemplatePart,Trees.TextBlock
- Enclosing class:
- ImmutableTrees
@Immutable public static final class ImmutableTrees.TextBlock extends java.lang.Object implements Trees.TextBlock
Immutable implementation ofTrees.TextBlock.Use the builder to create immutable instances:
ImmutableTrees.TextBlock.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableTrees.TextBlock.BuilderBuilds instances of typeTextBlock.
-
Field Summary
Fields Modifier and Type Field Description private com.google.common.collect.ImmutableList<Trees.TextPart>parts
-
Constructor Summary
Constructors Modifier Constructor Description privateTextBlock(com.google.common.collect.ImmutableList<Trees.TextPart> parts)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableTrees.TextBlock.Builderbuilder()Creates a builder forTextBlock.static ImmutableTrees.TextBlockcopyOf(Trees.TextBlock instance)Creates an immutable copy of aTrees.TextBlockvalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofTextBlockthat have equal attribute values.private booleanequalTo(int synthetic, ImmutableTrees.TextBlock another)inthashCode()Computes a hash code from attributes:parts.com.google.common.collect.ImmutableList<Trees.TextPart>parts()java.lang.StringtoString()Prints the immutable valueTextBlockwith attribute values.ImmutableTrees.TextBlockwithParts(java.lang.Iterable<? extends Trees.TextPart> elements)Copy the current immutable object with elements that replace the content ofparts.ImmutableTrees.TextBlockwithParts(Trees.TextPart... elements)Copy the current immutable object with elements that replace the content ofparts.
-
-
-
Field Detail
-
parts
private final com.google.common.collect.ImmutableList<Trees.TextPart> parts
-
-
Constructor Detail
-
TextBlock
private TextBlock(com.google.common.collect.ImmutableList<Trees.TextPart> parts)
-
-
Method Detail
-
parts
public com.google.common.collect.ImmutableList<Trees.TextPart> parts()
- Specified by:
partsin interfaceTrees.TextBlock- Returns:
- The value of the
partsattribute
-
withParts
public final ImmutableTrees.TextBlock withParts(Trees.TextPart... elements)
Copy the current immutable object with elements that replace the content ofparts.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withParts
public final ImmutableTrees.TextBlock withParts(java.lang.Iterable<? extends Trees.TextPart> elements)
Copy the current immutable object with elements that replace the content ofparts. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of parts elements to set- Returns:
- A modified copy of
thisobject
-
equals
public boolean equals(@Nullable java.lang.Object another)This instance is equal to all instances ofTextBlockthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
equalTo
private boolean equalTo(int synthetic, ImmutableTrees.TextBlock another)
-
hashCode
public int hashCode()
Computes a hash code from attributes:parts.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueTextBlockwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
copyOf
public static ImmutableTrees.TextBlock copyOf(Trees.TextBlock instance)
Creates an immutable copy of aTrees.TextBlockvalue. 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 TextBlock instance
-
builder
public static ImmutableTrees.TextBlock.Builder builder()
Creates a builder forTextBlock.ImmutableTrees.TextBlock.builder() .addParts|addAllParts(org.immutables.generator.processor.Trees.TextPart) //partselements .build();- Returns:
- A new TextBlock builder
-
-