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 ofStructurizer.Statement.Use the builder to create immutable instances:
new Structurizer.Statement.Builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableStructurizer.Statement.BuilderBuilds instances of typeStatement.private classImmutableStructurizer.Statement.InitShim
-
Field Summary
Fields Modifier and Type Field Description private com.google.common.collect.ImmutableList<Code.Term>annotationsprivate com.google.common.collect.ImmutableList<Code.Term>blockprivate com.google.common.collect.ImmutableList<Structurizer.Statement>definitionsprivate com.google.common.collect.ImmutableList<Code.Term>expressionprivate ImmutableStructurizer.Statement.InitShiminitShimprivate booleanisClassOrInterfaceprivate longlazyInitBitmapprivate com.google.common.base.Optional<java.lang.String>nameprivate com.google.common.collect.ImmutableList<Code.Term>parametersprivate static longRETURN_TYPE_LAZY_INIT_BITprivate java.util.List<Code.Term>returnTypeprivate com.google.common.collect.ImmutableList<Code.Term>signatureprivate static byteSTAGE_INITIALIZEDprivate static byteSTAGE_INITIALIZINGprivate static byteSTAGE_UNINITIALIZED
-
Constructor Summary
Constructors Modifier Constructor Description privateStatement(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)privateStatement(ImmutableStructurizer.Statement.Builder builder)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) com.google.common.collect.ImmutableList<Code.Term>annotations()(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>definitions()booleanequals(java.lang.Object another)This 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>expression()inthashCode()Computes a hash code from attributes:annotations,signature,parameters,expression,block,definitions,isClassOrInterface,name.(package private) booleanisClassOrInterface()(package private) com.google.common.base.Optional<java.lang.String>name()(package private) com.google.common.collect.ImmutableList<Code.Term>parameters()(package private) java.util.List<Code.Term>returnType()(package private) com.google.common.collect.ImmutableList<Code.Term>signature()java.lang.StringtoString()Prints the immutable valueStatementwith attribute values.ImmutableStructurizer.StatementwithAnnotations(java.lang.Iterable<? extends Code.Term> elements)Copy the current immutable object with elements that replace the content ofannotations.ImmutableStructurizer.StatementwithAnnotations(Code.Term... elements)Copy the current immutable object with elements that replace the content ofannotations.ImmutableStructurizer.StatementwithBlock(java.lang.Iterable<? extends Code.Term> elements)Copy the current immutable object with elements that replace the content ofblock.ImmutableStructurizer.StatementwithBlock(Code.Term... elements)Copy the current immutable object with elements that replace the content ofblock.ImmutableStructurizer.StatementwithDefinitions(java.lang.Iterable<? extends Structurizer.Statement> elements)Copy the current immutable object with elements that replace the content ofdefinitions.ImmutableStructurizer.StatementwithDefinitions(Structurizer.Statement... elements)Copy the current immutable object with elements that replace the content ofdefinitions.ImmutableStructurizer.StatementwithExpression(java.lang.Iterable<? extends Code.Term> elements)Copy the current immutable object with elements that replace the content ofexpression.ImmutableStructurizer.StatementwithExpression(Code.Term... elements)Copy the current immutable object with elements that replace the content ofexpression.ImmutableStructurizer.StatementwithName(com.google.common.base.Optional<java.lang.String> value)Copy the current immutable object by setting a value for thenameattribute.ImmutableStructurizer.StatementwithParameters(java.lang.Iterable<? extends Code.Term> elements)Copy the current immutable object with elements that replace the content ofparameters.ImmutableStructurizer.StatementwithParameters(Code.Term... elements)Copy the current immutable object with elements that replace the content ofparameters.ImmutableStructurizer.StatementwithSignature(java.lang.Iterable<? extends Code.Term> elements)Copy the current immutable object with elements that replace the content ofsignature.ImmutableStructurizer.StatementwithSignature(Code.Term... elements)Copy the current immutable object with elements that replace the content ofsignature.
-
-
-
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
-
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<java.lang.String> name
-
STAGE_INITIALIZING
private static final byte STAGE_INITIALIZING
- See Also:
- Constant Field Values
-
STAGE_UNINITIALIZED
private static final byte STAGE_UNINITIALIZED
- See Also:
- Constant Field Values
-
STAGE_INITIALIZED
private static final byte STAGE_INITIALIZED
- See Also:
- Constant Field Values
-
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:
- Constant Field Values
-
returnType
private transient java.util.List<Code.Term> returnType
-
-
Constructor Detail
-
Statement
private Statement(ImmutableStructurizer.Statement.Builder builder)
-
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
-
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<java.lang.String> name()
- Overrides:
namein classStructurizer.Statement- Returns:
- The value of the
nameattribute
-
withAnnotations
public final ImmutableStructurizer.Statement withAnnotations(Code.Term... elements)
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(java.lang.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
public final ImmutableStructurizer.Statement withSignature(Code.Term... elements)
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
public final ImmutableStructurizer.Statement withSignature(java.lang.Iterable<? extends Code.Term> elements)
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
public final ImmutableStructurizer.Statement withParameters(Code.Term... elements)
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
public final ImmutableStructurizer.Statement withParameters(java.lang.Iterable<? extends Code.Term> elements)
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
public final ImmutableStructurizer.Statement withExpression(Code.Term... elements)
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
public final ImmutableStructurizer.Statement withExpression(java.lang.Iterable<? extends Code.Term> elements)
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
public final ImmutableStructurizer.Statement withBlock(Code.Term... elements)
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
public final ImmutableStructurizer.Statement withBlock(java.lang.Iterable<? extends Code.Term> elements)
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
public final ImmutableStructurizer.Statement withDefinitions(Structurizer.Statement... elements)
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(java.lang.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<java.lang.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
public boolean equals(@Nullable java.lang.Object another)This instance is equal to all instances ofStatementthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
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:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueStatementwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
returnType
java.util.List<Code.Term> 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
public static Structurizer.Statement copyOf(Structurizer.Statement instance)
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
-
-