Class ImmutableTrees.IterationGenerator

java.lang.Object
org.immutables.generator.processor.ImmutableTrees.IterationGenerator
All Implemented Interfaces:
Trees.GeneratorDeclaration, Trees.GeneratorValueDeclaration, Trees.IterationGenerator
Enclosing class:
ImmutableTrees

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

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

  • Field Details

  • Constructor Details

  • Method Details

    • declaration

      public Trees.ValueDeclaration declaration()
      Specified by:
      declaration in interface Trees.GeneratorValueDeclaration
      Returns:
      The value of the declaration attribute
    • from

      public Trees.Expression from()
      Specified by:
      from in interface Trees.GeneratorValueDeclaration
      Returns:
      The value of the from attribute
    • condition

      public com.google.common.base.Optional<Trees.Expression> condition()
      Specified by:
      condition in interface Trees.IterationGenerator
      Returns:
      The value of the condition attribute
    • withDeclaration

      public final ImmutableTrees.IterationGenerator withDeclaration(Trees.ValueDeclaration value)
      Copy the current immutable object by setting a value for the declaration attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for declaration
      Returns:
      A modified copy of the this object
    • withFrom

      public final ImmutableTrees.IterationGenerator withFrom(Trees.Expression value)
      Copy the current immutable object by setting a value for the from attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for from
      Returns:
      A modified copy of the this object
    • withCondition

      public final ImmutableTrees.IterationGenerator withCondition(Trees.Expression value)
      Copy the current immutable object by setting a present value for the optional condition attribute.
      Parameters:
      value - The value for condition
      Returns:
      A modified copy of this object
    • withCondition

      public final ImmutableTrees.IterationGenerator withCondition(com.google.common.base.Optional<? extends Trees.Expression> optional)
      Copy the current immutable object by setting an optional value for the condition attribute. A shallow reference equality check on the optional value is used to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for condition
      Returns:
      A modified copy of this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of IterationGenerator 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.IterationGenerator another)
    • hashCode

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

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

      Creates an immutable copy of a Trees.IterationGenerator 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 IterationGenerator instance
    • builder

      Creates a builder for IterationGenerator.
       ImmutableTrees.IterationGenerator.builder()
          .declaration(org.immutables.generator.processor.Trees.ValueDeclaration) // required declaration
          .from(org.immutables.generator.processor.Trees.Expression) // required from
          .condition(org.immutables.generator.processor.Trees.Expression) // optional condition
          .build();
       
      Returns:
      A new IterationGenerator builder