Class ImmutableTrees.For

java.lang.Object
org.immutables.generator.processor.ImmutableTrees.For
All Implemented Interfaces:
Trees.Directive, Trees.DirectiveStart, Trees.For, Trees.TemplatePart
Enclosing class:
ImmutableTrees

@Immutable public static final class ImmutableTrees.For extends Object implements Trees.For
Immutable implementation of Trees.For.

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

  • Field Details

  • Constructor Details

  • Method Details

    • declaration

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

      public final ImmutableTrees.For 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.For 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 For 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.For another)
    • hashCode

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

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

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

      public static ImmutableTrees.For.Builder builder()
      Creates a builder for For.
       ImmutableTrees.For.builder()
          .addDeclaration|addAllDeclaration(org.immutables.generator.processor.Trees.GeneratorDeclaration) // declaration elements
          .build();
       
      Returns:
      A new For builder