Class ImmutableRound
- java.lang.Object
-
- org.immutables.value.processor.meta.Round
-
- org.immutables.value.processor.meta.ImmutableRound
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableRound.BuilderBuilds instances of typeImmutableRound.
-
Field Summary
Fields Modifier and Type Field Description private com.google.common.collect.ImmutableSet<javax.lang.model.element.TypeElement>annotationsprivate ValueTypeComposercomposerprivate com.google.common.collect.ImmutableSet<java.lang.String>customImmutableAnnotationsprivate Proto.Environmentenvironmentprivate static longENVIRONMENT_LAZY_INIT_BITprivate longlazyInitBitmapprivate javax.annotation.processing.ProcessingEnvironmentprocessingprivate javax.annotation.processing.RoundEnvironmentround
-
Constructor Summary
Constructors Modifier Constructor Description privateImmutableRound(javax.annotation.processing.ProcessingEnvironment processing, javax.annotation.processing.RoundEnvironment round, com.google.common.collect.ImmutableSet<javax.lang.model.element.TypeElement> annotations, com.google.common.collect.ImmutableSet<java.lang.String> customImmutableAnnotations)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.google.common.collect.ImmutableSet<javax.lang.model.element.TypeElement>annotations()static ImmutableRound.Builderbuilder()Creates a builder forImmutableRound.(package private) ValueTypeComposercomposer()static ImmutableRoundcopyOf(Round instance)Creates an immutable copy of aRoundvalue.com.google.common.collect.ImmutableSet<java.lang.String>customImmutableAnnotations()Proto.Environmentenvironment()booleanequals(java.lang.Object another)This instance is equal to all instances ofImmutableRoundthat have equal attribute values.private booleanequalTo(int synthetic, ImmutableRound another)inthashCode()Computes a hash code from attributes:processing,round,annotations,customImmutableAnnotations,composer.javax.annotation.processing.ProcessingEnvironmentprocessing()javax.annotation.processing.RoundEnvironmentround()java.lang.StringtoString()Prints the immutable valueRoundwith attribute values.ImmutableRoundwithAnnotations(java.lang.Iterable<? extends javax.lang.model.element.TypeElement> elements)Copy the current immutable object with elements that replace the content ofannotations.ImmutableRoundwithAnnotations(javax.lang.model.element.TypeElement... elements)Copy the current immutable object with elements that replace the content ofannotations.ImmutableRoundwithCustomImmutableAnnotations(java.lang.Iterable<java.lang.String> elements)Copy the current immutable object with elements that replace the content ofcustomImmutableAnnotations.ImmutableRoundwithCustomImmutableAnnotations(java.lang.String... elements)Copy the current immutable object with elements that replace the content ofcustomImmutableAnnotations.ImmutableRoundwithProcessing(javax.annotation.processing.ProcessingEnvironment value)Copy the current immutable object by setting a value for theprocessingattribute.ImmutableRoundwithRound(javax.annotation.processing.RoundEnvironment value)Copy the current immutable object by setting a value for theroundattribute.-
Methods inherited from class org.immutables.value.processor.meta.Round
collectProtoclasses, collectValues, composeValue, declaringTypeFrom, inferDeclaringTypeFor, protoclassesFrom, wrapElement, wrapElement, wrapElement
-
-
-
-
Field Detail
-
processing
private final javax.annotation.processing.ProcessingEnvironment processing
-
round
private final javax.annotation.processing.RoundEnvironment round
-
annotations
private final com.google.common.collect.ImmutableSet<javax.lang.model.element.TypeElement> annotations
-
customImmutableAnnotations
private final com.google.common.collect.ImmutableSet<java.lang.String> customImmutableAnnotations
-
composer
private final transient ValueTypeComposer composer
-
lazyInitBitmap
private transient volatile long lazyInitBitmap
-
ENVIRONMENT_LAZY_INIT_BIT
private static final long ENVIRONMENT_LAZY_INIT_BIT
- See Also:
- Constant Field Values
-
environment
private transient Proto.Environment environment
-
-
Constructor Detail
-
ImmutableRound
private ImmutableRound(javax.annotation.processing.ProcessingEnvironment processing, javax.annotation.processing.RoundEnvironment round, com.google.common.collect.ImmutableSet<javax.lang.model.element.TypeElement> annotations, com.google.common.collect.ImmutableSet<java.lang.String> customImmutableAnnotations)
-
-
Method Detail
-
processing
public javax.annotation.processing.ProcessingEnvironment processing()
- Specified by:
processingin classRound- Returns:
- The value of the
processingattribute
-
round
public javax.annotation.processing.RoundEnvironment round()
-
annotations
public com.google.common.collect.ImmutableSet<javax.lang.model.element.TypeElement> annotations()
- Specified by:
annotationsin classRound- Returns:
- The value of the
annotationsattribute
-
customImmutableAnnotations
public com.google.common.collect.ImmutableSet<java.lang.String> customImmutableAnnotations()
- Specified by:
customImmutableAnnotationsin classRound- Returns:
- The value of the
customImmutableAnnotationsattribute
-
composer
ValueTypeComposer composer()
-
withProcessing
public final ImmutableRound withProcessing(javax.annotation.processing.ProcessingEnvironment value)
Copy the current immutable object by setting a value for theprocessingattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for processing- Returns:
- A modified copy of the
thisobject
-
withRound
public final ImmutableRound withRound(javax.annotation.processing.RoundEnvironment value)
Copy the current immutable object by setting a value for theroundattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for round- Returns:
- A modified copy of the
thisobject
-
withAnnotations
public final ImmutableRound withAnnotations(javax.lang.model.element.TypeElement... 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 ImmutableRound withAnnotations(java.lang.Iterable<? extends javax.lang.model.element.TypeElement> 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
-
withCustomImmutableAnnotations
public final ImmutableRound withCustomImmutableAnnotations(java.lang.String... elements)
Copy the current immutable object with elements that replace the content ofcustomImmutableAnnotations.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withCustomImmutableAnnotations
public final ImmutableRound withCustomImmutableAnnotations(java.lang.Iterable<java.lang.String> elements)
Copy the current immutable object with elements that replace the content ofcustomImmutableAnnotations. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of customImmutableAnnotations elements to set- Returns:
- A modified copy of
thisobject
-
equals
public boolean equals(@Nullable java.lang.Object another)This instance is equal to all instances ofImmutableRoundthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
equalTo
private boolean equalTo(int synthetic, ImmutableRound another)
-
hashCode
public int hashCode()
Computes a hash code from attributes:processing,round,annotations,customImmutableAnnotations,composer.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueRoundwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
environment
public Proto.Environment environment()
Returns a lazily initialized value of the
environmentattribute. 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:
environmentin classRound- Returns:
- A lazily initialized value of the
environmentattribute
-
copyOf
public static ImmutableRound copyOf(Round instance)
Creates an immutable copy of aRoundvalue. 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 Round instance
-
builder
public static ImmutableRound.Builder builder()
Creates a builder forImmutableRound.ImmutableRound.builder() .processing(javax.annotation.processing.ProcessingEnvironment) // requiredprocessing.round(javax.annotation.processing.RoundEnvironment) // requiredround.addAnnotations|addAllAnnotations(javax.lang.model.element.TypeElement) //annotationselements .addCustomImmutableAnnotations|addAllCustomImmutableAnnotations(String) //customImmutableAnnotationselements .build();- Returns:
- A new ImmutableRound builder
-
-