Class ImmutableTrees.ForStatement

java.lang.Object
org.immutables.generator.processor.Trees.ForStatement
org.immutables.generator.processor.ImmutableTrees.ForStatement
All Implemented Interfaces:
Trees.Block, Trees.Synthetic, Trees.TemplatePart
Enclosing class:
ImmutableTrees

@Immutable public static final class ImmutableTrees.ForStatement extends Trees.ForStatement
Immutable implementation of Trees.ForStatement.

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

  • Field Details

  • Constructor Details

  • Method Details

    • parts

      public com.google.common.collect.ImmutableList<Trees.TemplatePart> parts()
      Returns:
      The value of the parts attribute
    • useForAccess

      public boolean useForAccess()
      Overrides:
      useForAccess in class Trees.ForStatement
      Returns:
      The value of the useForAccess attribute
    • useDelimit

      public boolean useDelimit()
      Overrides:
      useDelimit in class Trees.ForStatement
      Returns:
      The value of the useDelimit attribute
    • declaration

      public com.google.common.collect.ImmutableList<Trees.GeneratorDeclaration> declaration()
      Specified by:
      declaration in class Trees.ForStatement
      Returns:
      The value of the declaration attribute
    • withParts

      public final ImmutableTrees.ForStatement withParts(Trees.TemplatePart... 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.ForStatement withParts(Iterable<? extends Trees.TemplatePart> 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
    • withUseForAccess

      public final ImmutableTrees.ForStatement withUseForAccess(boolean value)
      Copy the current immutable object by setting a value for the useForAccess attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for useForAccess
      Returns:
      A modified copy of the this object
    • withUseDelimit

      public final ImmutableTrees.ForStatement withUseDelimit(boolean value)
      Copy the current immutable object by setting a value for the useDelimit attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for useDelimit
      Returns:
      A modified copy of the this object
    • withDeclaration

      public final ImmutableTrees.ForStatement withDeclaration(Trees.GeneratorDeclaration... elements)
      Copy the current immutable object with elements that replace the content of declaration.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withDeclaration

      public final ImmutableTrees.ForStatement withDeclaration(Iterable<? extends Trees.GeneratorDeclaration> elements)
      Copy the current immutable object with elements that replace the content of declaration. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of declaration 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 ForStatement 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.ForStatement another)
    • hashCode

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

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

      public static ImmutableTrees.ForStatement copyOf(Trees.ForStatement instance)
      Creates an immutable copy of a Trees.ForStatement 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 ForStatement instance
    • builder

      public static ImmutableTrees.ForStatement.Builder builder()
      Creates a builder for ForStatement.
       ImmutableTrees.ForStatement.builder()
          .addParts|addAllParts(org.immutables.generator.processor.Trees.TemplatePart) // parts elements
          .useForAccess(boolean) // optional useForAccess
          .useDelimit(boolean) // optional useDelimit
          .addDeclaration|addAllDeclaration(org.immutables.generator.processor.Trees.GeneratorDeclaration) // declaration elements
          .build();
       
      Returns:
      A new ForStatement builder