Class ImmutableTrees.ConditionalBlock

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

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

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

  • Field Details

  • Constructor Details

  • Method Details

    • condition

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

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

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

      public final ImmutableTrees.ConditionalBlock 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.ConditionalBlock 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
    • equals

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

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

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

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

      public static ImmutableTrees.ConditionalBlock.Builder builder()
      Creates a builder for ConditionalBlock.
       ImmutableTrees.ConditionalBlock.builder()
          .condition(org.immutables.generator.processor.Trees.Expression) // required condition
          .addParts|addAllParts(org.immutables.generator.processor.Trees.TemplatePart) // parts elements
          .build();
       
      Returns:
      A new ConditionalBlock builder