Class ImmutableReporter
- java.lang.Object
-
- org.immutables.value.processor.meta.Reporter
-
- org.immutables.value.processor.meta.ImmutableReporter
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.immutables.value.processor.meta.Reporter
Reporter.About
-
-
Field Summary
Fields Modifier and Type Field Description private com.google.common.base.Optional<javax.lang.model.element.AnnotationMirror>annotationprivate com.google.common.base.Optional<javax.lang.model.element.Element>elementprivate javax.annotation.processing.Messagermessager
-
Constructor Summary
Constructors Modifier Constructor Description privateImmutableReporter(javax.annotation.processing.Messager messager)privateImmutableReporter(javax.annotation.processing.Messager messager, com.google.common.base.Optional<javax.lang.model.element.Element> element, com.google.common.base.Optional<javax.lang.model.element.AnnotationMirror> annotation)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) com.google.common.base.Optional<javax.lang.model.element.AnnotationMirror>annotation()static ImmutableReportercopyOf(Reporter instance)Creates an immutable copy of aReportervalue.(package private) com.google.common.base.Optional<javax.lang.model.element.Element>element()booleanequals(java.lang.Object another)This instance is equal to all instances ofImmutableReporterthat have equal attribute values.private booleanequalTo(int synthetic, ImmutableReporter another)inthashCode()Computes a hash code from attributes:messager,element,annotation.(package private) javax.annotation.processing.Messagermessager()static ImmutableReporterof(javax.annotation.processing.Messager messager)Construct a new immutableReporterinstance.java.lang.StringtoString()Prints the immutable valueReporterwith attribute values.ImmutableReporterwithAnnotation(com.google.common.base.Optional<? extends javax.lang.model.element.AnnotationMirror> optional)Copy the current immutable object by setting an optional value for theannotationattribute.ImmutableReporterwithAnnotation(javax.lang.model.element.AnnotationMirror value)Copy the current immutable object by setting a present value for the optionalannotationattribute.ImmutableReporterwithElement(com.google.common.base.Optional<? extends javax.lang.model.element.Element> optional)Copy the current immutable object by setting an optional value for theelementattribute.ImmutableReporterwithElement(javax.lang.model.element.Element value)Copy the current immutable object by setting a present value for the optionalelementattribute.ImmutableReporterwithMessager(javax.annotation.processing.Messager value)Copy the current immutable object by setting a value for themessagerattribute.-
Methods inherited from class org.immutables.value.processor.meta.Reporter
annotationNamed, error, forAnnotation, from, warning, warning
-
-
-
-
Constructor Detail
-
ImmutableReporter
private ImmutableReporter(javax.annotation.processing.Messager messager)
-
ImmutableReporter
private ImmutableReporter(javax.annotation.processing.Messager messager, com.google.common.base.Optional<javax.lang.model.element.Element> element, com.google.common.base.Optional<javax.lang.model.element.AnnotationMirror> annotation)
-
-
Method Detail
-
messager
javax.annotation.processing.Messager messager()
-
element
com.google.common.base.Optional<javax.lang.model.element.Element> element()
-
annotation
com.google.common.base.Optional<javax.lang.model.element.AnnotationMirror> annotation()
- Specified by:
annotationin classReporter- Returns:
- The value of the
annotationattribute
-
withMessager
public final ImmutableReporter withMessager(javax.annotation.processing.Messager value)
Copy the current immutable object by setting a value for themessagerattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for messager- Returns:
- A modified copy of the
thisobject
-
withElement
public final ImmutableReporter withElement(javax.lang.model.element.Element value)
Copy the current immutable object by setting a present value for the optionalelementattribute.- Specified by:
withElementin classReporter- Parameters:
value- The value for element- Returns:
- A modified copy of
thisobject
-
withElement
public final ImmutableReporter withElement(com.google.common.base.Optional<? extends javax.lang.model.element.Element> optional)
Copy the current immutable object by setting an optional value for theelementattribute. A shallow reference equality check on the optional value is used to prevent copying of the same value by returningthis.- Parameters:
optional- A value for element- Returns:
- A modified copy of
thisobject
-
withAnnotation
public final ImmutableReporter withAnnotation(javax.lang.model.element.AnnotationMirror value)
Copy the current immutable object by setting a present value for the optionalannotationattribute.- Specified by:
withAnnotationin classReporter- Parameters:
value- The value for annotation- Returns:
- A modified copy of
thisobject
-
withAnnotation
public final ImmutableReporter withAnnotation(com.google.common.base.Optional<? extends javax.lang.model.element.AnnotationMirror> optional)
Copy the current immutable object by setting an optional value for theannotationattribute. A shallow reference equality check on the optional value is used to prevent copying of the same value by returningthis.- Parameters:
optional- A value for annotation- Returns:
- A modified copy of
thisobject
-
equals
public boolean equals(@Nullable java.lang.Object another)This instance is equal to all instances ofImmutableReporterthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
equalTo
private boolean equalTo(int synthetic, ImmutableReporter another)
-
hashCode
public int hashCode()
Computes a hash code from attributes:messager,element,annotation.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueReporterwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
of
public static ImmutableReporter of(javax.annotation.processing.Messager messager)
Construct a new immutableReporterinstance.- Parameters:
messager- The value for themessagerattribute- Returns:
- An immutable Reporter instance
-
copyOf
public static ImmutableReporter copyOf(Reporter instance)
Creates an immutable copy of aReportervalue. 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 Reporter instance
-
-