Class ImmutableTrees.Invoke

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

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

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

  • Field Details

  • Constructor Details

  • Method Details

    • access

      public Trees.AccessExpression access()
      Specified by:
      access in interface Trees.InvokeDeclaration
      Returns:
      The value of the access attribute
    • invoke

      public com.google.common.base.Optional<Trees.ApplyExpression> invoke()
      Specified by:
      invoke in interface Trees.InvokeDeclaration
      Returns:
      The value of the invoke attribute
    • withAccess

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

      public final ImmutableTrees.Invoke withInvoke(Trees.ApplyExpression value)
      Copy the current immutable object by setting a present value for the optional invoke attribute.
      Parameters:
      value - The value for invoke
      Returns:
      A modified copy of this object
    • withInvoke

      public final ImmutableTrees.Invoke withInvoke(com.google.common.base.Optional<? extends Trees.ApplyExpression> optional)
      Copy the current immutable object by setting an optional value for the invoke 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 invoke
      Returns:
      A modified copy of this object
    • equals

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

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

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

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

      public static ImmutableTrees.Invoke.Builder builder()
      Creates a builder for Invoke.
       ImmutableTrees.Invoke.builder()
          .access(org.immutables.generator.processor.Trees.AccessExpression) // required access
          .invoke(org.immutables.generator.processor.Trees.ApplyExpression) // optional invoke
          .build();
       
      Returns:
      A new Invoke builder