Class ImmutableReporter
java.lang.Object
org.immutables.value.processor.meta.Reporter
org.immutables.value.processor.meta.ImmutableReporter
@ParametersAreNonnullByDefault
@Generated("org.immutables.processor.ProxyProcessor")
@Immutable
public final class ImmutableReporter
extends Reporter
Immutable implementation of
Reporter.
Use the static factory method to create immutable instances:
ImmutableReporter.of().
-
Nested Class Summary
Nested classes/interfaces inherited from class org.immutables.value.processor.meta.Reporter
Reporter.About -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final com.google.common.base.Optional<AnnotationMirror> private final com.google.common.base.Optional<Element> private final Messager -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateImmutableReporter(Messager messager) privateImmutableReporter(Messager messager, com.google.common.base.Optional<Element> element, com.google.common.base.Optional<AnnotationMirror> annotation) -
Method Summary
Modifier and TypeMethodDescription(package private) com.google.common.base.Optional<AnnotationMirror> static ImmutableReporterCreates an immutable copy of aReportervalue.(package private) com.google.common.base.Optional<Element> element()booleanThis 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) Messagermessager()static ImmutableReporterConstruct a new immutableReporterinstance.toString()Prints the immutable valueReporterwith attribute values.final ImmutableReporterwithAnnotation(com.google.common.base.Optional<? extends AnnotationMirror> optional) Copy the current immutable object by setting an optional value for theannotationattribute.final ImmutableReporterwithAnnotation(AnnotationMirror value) Copy the current immutable object by setting a present value for the optionalannotationattribute.final ImmutableReporterwithElement(com.google.common.base.Optional<? extends Element> optional) Copy the current immutable object by setting an optional value for theelementattribute.final ImmutableReporterwithElement(Element value) Copy the current immutable object by setting a present value for the optionalelementattribute.final ImmutableReporterwithMessager(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
-
Field Details
-
messager
-
element
-
annotation
-
-
Constructor Details
-
ImmutableReporter
-
ImmutableReporter
private ImmutableReporter(Messager messager, com.google.common.base.Optional<Element> element, com.google.common.base.Optional<AnnotationMirror> annotation)
-
-
Method Details
-
messager
Messager messager() -
element
com.google.common.base.Optional<Element> element() -
annotation
com.google.common.base.Optional<AnnotationMirror> annotation()- Specified by:
annotationin classReporter- Returns:
- The value of the
annotationattribute
-
withMessager
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
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 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
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 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
This instance is equal to all instances ofImmutableReporterthat have equal attribute values. -
equalTo
-
hashCode
public int hashCode()Computes a hash code from attributes:messager,element,annotation. -
toString
Prints the immutable valueReporterwith attribute values. -
of
Construct a new immutableReporterinstance.- Parameters:
messager- The value for themessagerattribute- Returns:
- An immutable Reporter instance
-
copyOf
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
-