Class ImmutableStructurizer.Statement
java.lang.Object
org.immutables.value.processor.encode.Structurizer.Statement
org.immutables.value.processor.encode.ImmutableStructurizer.Statement
- Enclosing class:
ImmutableStructurizer
Immutable implementation of
Structurizer.Statement.
Use the builder to create immutable instances:
new Structurizer.Statement.Builder().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilds instances of typeStatement.private final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final com.google.common.collect.ImmutableList<Code.Term> private final com.google.common.collect.ImmutableList<Code.Term> private final com.google.common.collect.ImmutableList<Structurizer.Statement> private final com.google.common.collect.ImmutableList<Code.Term> private final booleanprivate longprivate final com.google.common.base.Optional<String> private final com.google.common.collect.ImmutableList<Code.Term> private static final longprivate final com.google.common.collect.ImmutableList<Code.Term> private static final byteprivate static final byteprivate static final byte -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateStatement(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<String> name) private -
Method Summary
Modifier and TypeMethodDescription(package private) com.google.common.collect.ImmutableList<Code.Term> (package private) com.google.common.collect.ImmutableList<Code.Term> block()static Structurizer.StatementcopyOf(Structurizer.Statement instance) Creates an immutable copy of aStructurizer.Statementvalue.(package private) com.google.common.collect.ImmutableList<Structurizer.Statement> booleanThis instance is equal to all instances ofStatementthat have equal attribute values.private booleanequalTo(int synthetic, ImmutableStructurizer.Statement another) (package private) com.google.common.collect.ImmutableList<Code.Term> inthashCode()Computes a hash code from attributes:annotations,signature,parameters,expression,block,definitions,isClassOrInterface,name.(package private) boolean(package private) com.google.common.base.Optional<String> name()(package private) com.google.common.collect.ImmutableList<Code.Term> (package private) com.google.common.collect.ImmutableList<Code.Term> toString()Prints the immutable valueStatementwith attribute values.withAnnotations(Iterable<? extends Code.Term> elements) Copy the current immutable object with elements that replace the content ofannotations.withAnnotations(Code.Term... elements) Copy the current immutable object with elements that replace the content ofannotations.Copy the current immutable object with elements that replace the content ofblock.Copy the current immutable object with elements that replace the content ofblock.withDefinitions(Iterable<? extends Structurizer.Statement> elements) Copy the current immutable object with elements that replace the content ofdefinitions.withDefinitions(Structurizer.Statement... elements) Copy the current immutable object with elements that replace the content ofdefinitions.withExpression(Iterable<? extends Code.Term> elements) Copy the current immutable object with elements that replace the content ofexpression.withExpression(Code.Term... elements) Copy the current immutable object with elements that replace the content ofexpression.Copy the current immutable object by setting a value for thenameattribute.withParameters(Iterable<? extends Code.Term> elements) Copy the current immutable object with elements that replace the content ofparameters.withParameters(Code.Term... elements) Copy the current immutable object with elements that replace the content ofparameters.withSignature(Iterable<? extends Code.Term> elements) Copy the current immutable object with elements that replace the content ofsignature.withSignature(Code.Term... elements) Copy the current immutable object with elements that replace the content ofsignature.
-
Field Details
-
annotations
-
signature
-
parameters
-
expression
-
block
-
definitions
-
isClassOrInterface
private final transient boolean isClassOrInterface -
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
-
lazyInitBitmap
private transient volatile long lazyInitBitmap -
RETURN_TYPE_LAZY_INIT_BIT
private static final long RETURN_TYPE_LAZY_INIT_BIT- See Also:
-
returnType
-
-
Constructor Details
-
Statement
-
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<String> name)
-
-
Method Details
-
annotations
com.google.common.collect.ImmutableList<Code.Term> annotations()- Specified by:
annotationsin classStructurizer.Statement- Returns:
- The value of the
annotationsattribute
-
signature
com.google.common.collect.ImmutableList<Code.Term> signature()- Specified by:
signaturein classStructurizer.Statement- Returns:
- The value of the
signatureattribute
-
parameters
com.google.common.collect.ImmutableList<Code.Term> parameters()- Specified by:
parametersin classStructurizer.Statement- Returns:
- The value of the
parametersattribute
-
expression
com.google.common.collect.ImmutableList<Code.Term> expression()- Specified by:
expressionin classStructurizer.Statement- Returns:
- The value of the
expressionattribute
-
block
com.google.common.collect.ImmutableList<Code.Term> block()- Specified by:
blockin classStructurizer.Statement- Returns:
- The value of the
blockattribute
-
definitions
com.google.common.collect.ImmutableList<Structurizer.Statement> definitions()- Specified by:
definitionsin classStructurizer.Statement- Returns:
- The value of the
definitionsattribute
-
isClassOrInterface
boolean isClassOrInterface()- Overrides:
isClassOrInterfacein classStructurizer.Statement- Returns:
- The computed-at-construction value of the
isClassOrInterfaceattribute
-
name
com.google.common.base.Optional<String> name()- Overrides:
namein classStructurizer.Statement- Returns:
- The value of the
nameattribute
-
withAnnotations
Copy the current immutable object with elements that replace the content ofannotations.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withAnnotations
public final ImmutableStructurizer.Statement withAnnotations(Iterable<? extends Code.Term> elements) Copy the current immutable object with elements that replace the content ofannotations. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of annotations elements to set- Returns:
- A modified copy of
thisobject
-
withSignature
Copy the current immutable object with elements that replace the content ofsignature.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withSignature
Copy the current immutable object with elements that replace the content ofsignature. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of signature elements to set- Returns:
- A modified copy of
thisobject
-
withParameters
Copy the current immutable object with elements that replace the content ofparameters.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withParameters
Copy the current immutable object with elements that replace the content ofparameters. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of parameters elements to set- Returns:
- A modified copy of
thisobject
-
withExpression
Copy the current immutable object with elements that replace the content ofexpression.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withExpression
Copy the current immutable object with elements that replace the content ofexpression. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of expression elements to set- Returns:
- A modified copy of
thisobject
-
withBlock
Copy the current immutable object with elements that replace the content ofblock.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withBlock
Copy the current immutable object with elements that replace the content ofblock. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of block elements to set- Returns:
- A modified copy of
thisobject
-
withDefinitions
Copy the current immutable object with elements that replace the content ofdefinitions.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withDefinitions
public final ImmutableStructurizer.Statement withDefinitions(Iterable<? extends Structurizer.Statement> elements) Copy the current immutable object with elements that replace the content ofdefinitions. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of definitions elements to set- Returns:
- A modified copy of
thisobject
-
withName
public final ImmutableStructurizer.Statement withName(com.google.common.base.Optional<String> value) Copy the current immutable object by setting a value for thenameattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for name- Returns:
- A modified copy of the
thisobject
-
equals
This instance is equal to all instances ofStatementthat have equal attribute values. -
equalTo
-
hashCode
public int hashCode()Computes a hash code from attributes:annotations,signature,parameters,expression,block,definitions,isClassOrInterface,name. -
toString
Prints the immutable valueStatementwith attribute values. -
returnType
Returns a lazily initialized value of the
returnTypeattribute. 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:
returnTypein classStructurizer.Statement- Returns:
- A lazily initialized value of the
returnTypeattribute
-
copyOf
Creates an immutable copy of aStructurizer.Statementvalue. 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
-