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 Object implements Trees.TextBlock
Immutable implementation of Trees.TextBlock.

Use the builder to create immutable instances: ImmutableTrees.TextBlock.builder().

  • Field Details

    • parts

      private final com.google.common.collect.ImmutableList<Trees.TextPart> parts
  • Constructor Details

    • TextBlock

      private TextBlock(com.google.common.collect.ImmutableList<Trees.TextPart> parts)
  • Method Details

    • parts

      public com.google.common.collect.ImmutableList<Trees.TextPart> parts()
      Specified by:
      parts in interface Trees.TextBlock
      Returns:
      The value of the parts attribute
    • withParts

      public final ImmutableTrees.TextBlock withParts(Trees.TextPart... elements)
      Copy the current immutable object with elements that replace the content of parts.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withParts

      public final ImmutableTrees.TextBlock withParts(Iterable<? extends Trees.TextPart> elements)
      Copy the current immutable object with elements that replace the content of parts. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of parts elements to set
      Returns:
      A modified copy of this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of TextBlock that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • equalTo

      private boolean equalTo(int synthetic, ImmutableTrees.TextBlock another)
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: parts.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value TextBlock with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • copyOf

      public static ImmutableTrees.TextBlock copyOf(Trees.TextBlock instance)
      Creates an immutable copy of a Trees.TextBlock value. 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 for TextBlock.
       ImmutableTrees.TextBlock.builder()
          .addParts|addAllParts(org.immutables.generator.processor.Trees.TextPart) // parts elements
          .build();
       
      Returns:
      A new TextBlock builder