Class ImmutableStructurizer.Statement

    • Field Detail

      • 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
      • isClassOrInterface

        private final transient boolean isClassOrInterface
      • name

        private final com.google.common.base.Optional<java.lang.String> name
      • lazyInitBitmap

        private transient volatile long lazyInitBitmap
      • RETURN_TYPE_LAZY_INIT_BIT

        private static final long RETURN_TYPE_LAZY_INIT_BIT
        See Also:
        Constant Field Values
      • returnType

        private transient java.util.List<Code.Term> returnType
    • Constructor Detail

      • Statement

        private Statement​(com.google.common.collect.ImmutableList<Code.Term> annotations,
                          com.google.common.collect.ImmutableList<Code.Term> signature,
                          com.google.common.collect.ImmutableList<Code.Term> parameters,
                          com.google.common.collect.ImmutableList<Code.Term> expression,
                          com.google.common.collect.ImmutableList<Code.Term> block,
                          com.google.common.collect.ImmutableList<Structurizer.Statement> definitions,
                          com.google.common.base.Optional<java.lang.String> name)
    • Method Detail

      • name

        com.google.common.base.Optional<java.lang.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​(java.lang.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​(java.lang.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​(java.lang.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​(java.lang.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​(java.lang.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​(java.lang.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<java.lang.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
                              java.lang.Object another)
        This instance is equal to all instances of Statement that have equal attribute values.
        Overrides:
        equals in class java.lang.Object
        Returns:
        true if this is equal to another instance
      • hashCode

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

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

        java.util.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