Class ImmutableStructurizer.Statement

java.lang.Object
org.immutables.value.processor.encode.Structurizer.Statement
org.immutables.value.processor.encode.ImmutableStructurizer.Statement
Enclosing class:
ImmutableStructurizer

@Immutable static final class ImmutableStructurizer.Statement extends Structurizer.Statement
Immutable implementation of Structurizer.Statement.

Use the builder to create immutable instances: new Structurizer.Statement.Builder().

  • Field Details

    • annotations

      private final com.google.common.collect.ImmutableList<Code.Term> annotations
    • signature

      private final com.google.common.collect.ImmutableList<Code.Term> signature
    • parameters

      private final com.google.common.collect.ImmutableList<Code.Term> parameters
    • expression

      private final com.google.common.collect.ImmutableList<Code.Term> expression
    • block

      private final com.google.common.collect.ImmutableList<Code.Term> block
    • definitions

      private final com.google.common.collect.ImmutableList<Structurizer.Statement> definitions
    • isClassOrInterface

      private final transient boolean isClassOrInterface
    • name

      private final com.google.common.base.Optional<String> name
    • STAGE_INITIALIZING

      private static final byte STAGE_INITIALIZING
      See Also:
    • STAGE_UNINITIALIZED

      private static final byte STAGE_UNINITIALIZED
      See Also:
    • STAGE_INITIALIZED

      private static final byte STAGE_INITIALIZED
      See Also:
    • initShim

      private transient volatile ImmutableStructurizer.Statement.InitShim initShim
    • lazyInitBitmap

      private transient volatile long lazyInitBitmap
    • RETURN_TYPE_LAZY_INIT_BIT

      private static final long RETURN_TYPE_LAZY_INIT_BIT
      See Also:
    • returnType

      private transient List<Code.Term> returnType
  • Constructor Details

  • Method Details

    • annotations

      com.google.common.collect.ImmutableList<Code.Term> annotations()
      Specified by:
      annotations in class Structurizer.Statement
      Returns:
      The value of the annotations attribute
    • signature

      com.google.common.collect.ImmutableList<Code.Term> signature()
      Specified by:
      signature in class Structurizer.Statement
      Returns:
      The value of the signature attribute
    • parameters

      com.google.common.collect.ImmutableList<Code.Term> parameters()
      Specified by:
      parameters in class Structurizer.Statement
      Returns:
      The value of the parameters attribute
    • expression

      com.google.common.collect.ImmutableList<Code.Term> expression()
      Specified by:
      expression in class Structurizer.Statement
      Returns:
      The value of the expression attribute
    • block

      com.google.common.collect.ImmutableList<Code.Term> block()
      Specified by:
      block in class Structurizer.Statement
      Returns:
      The value of the block attribute
    • definitions

      com.google.common.collect.ImmutableList<Structurizer.Statement> definitions()
      Specified by:
      definitions in class Structurizer.Statement
      Returns:
      The value of the definitions attribute
    • isClassOrInterface

      boolean isClassOrInterface()
      Overrides:
      isClassOrInterface in class Structurizer.Statement
      Returns:
      The computed-at-construction value of the isClassOrInterface attribute
    • name

      com.google.common.base.Optional<String> name()
      Overrides:
      name in class Structurizer.Statement
      Returns:
      The value of the name attribute
    • withAnnotations

      public final ImmutableStructurizer.Statement withAnnotations(Code.Term... elements)
      Copy the current immutable object with elements that replace the content of annotations.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withAnnotations

      public final ImmutableStructurizer.Statement withAnnotations(Iterable<? extends Code.Term> elements)
      Copy the current immutable object with elements that replace the content of annotations. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of annotations elements to set
      Returns:
      A modified copy of this object
    • withSignature

      public final ImmutableStructurizer.Statement withSignature(Code.Term... elements)
      Copy the current immutable object with elements that replace the content of signature.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withSignature

      public final ImmutableStructurizer.Statement withSignature(Iterable<? extends Code.Term> elements)
      Copy the current immutable object with elements that replace the content of signature. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of signature elements to set
      Returns:
      A modified copy of this object
    • withParameters

      public final ImmutableStructurizer.Statement withParameters(Code.Term... elements)
      Copy the current immutable object with elements that replace the content of parameters.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withParameters

      public final ImmutableStructurizer.Statement withParameters(Iterable<? extends Code.Term> elements)
      Copy the current immutable object with elements that replace the content of parameters. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of parameters elements to set
      Returns:
      A modified copy of this object
    • withExpression

      public final ImmutableStructurizer.Statement withExpression(Code.Term... elements)
      Copy the current immutable object with elements that replace the content of expression.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withExpression

      public final ImmutableStructurizer.Statement withExpression(Iterable<? extends Code.Term> elements)
      Copy the current immutable object with elements that replace the content of expression. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of expression elements to set
      Returns:
      A modified copy of this object
    • withBlock

      public final ImmutableStructurizer.Statement withBlock(Code.Term... elements)
      Copy the current immutable object with elements that replace the content of block.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withBlock

      public final ImmutableStructurizer.Statement withBlock(Iterable<? extends Code.Term> elements)
      Copy the current immutable object with elements that replace the content of block. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of block elements to set
      Returns:
      A modified copy of this object
    • withDefinitions

      public final ImmutableStructurizer.Statement withDefinitions(Structurizer.Statement... elements)
      Copy the current immutable object with elements that replace the content of definitions.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withDefinitions

      public final ImmutableStructurizer.Statement withDefinitions(Iterable<? extends Structurizer.Statement> elements)
      Copy the current immutable object with elements that replace the content of definitions. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of definitions elements to set
      Returns:
      A modified copy of this object
    • withName

      public final ImmutableStructurizer.Statement withName(com.google.common.base.Optional<String> value)
      Copy the current immutable object by setting a value for the name attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for name
      Returns:
      A modified copy of the this object
    • equals

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

      public int hashCode()
      Computes a hash code from attributes: annotations, signature, parameters, expression, block, definitions, isClassOrInterface, name.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      List<Code.Term> returnType()

      Returns a lazily initialized value of the returnType attribute. Initialized once and only once and stored for subsequent access with proper synchronization. In case of any exception or error thrown by the lazy value initializer, the result will not be memoised (i.e. remembered) and on next call computation will be attempted again.

      Overrides:
      returnType in class Structurizer.Statement
      Returns:
      A lazily initialized value of the returnType attribute
    • copyOf

      public static Structurizer.Statement copyOf(Structurizer.Statement instance)
      Creates an immutable copy of a Structurizer.Statement 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 Statement instance