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().

  • Field Details

    • messager

      private final Messager messager
    • element

      private final com.google.common.base.Optional<Element> element
    • annotation

      private final com.google.common.base.Optional<AnnotationMirror> annotation
  • Constructor Details

    • ImmutableReporter

      private ImmutableReporter(Messager messager)
    • ImmutableReporter

      private ImmutableReporter(Messager messager, com.google.common.base.Optional<Element> element, com.google.common.base.Optional<AnnotationMirror> annotation)
  • Method Details

    • messager

      Messager messager()
      Specified by:
      messager in class Reporter
      Returns:
      The value of the messager attribute
    • element

      com.google.common.base.Optional<Element> element()
      Specified by:
      element in class Reporter
      Returns:
      The value of the element attribute
    • annotation

      com.google.common.base.Optional<AnnotationMirror> annotation()
      Specified by:
      annotation in class Reporter
      Returns:
      The value of the annotation attribute
    • withMessager

      public final ImmutableReporter withMessager(Messager value)
      Copy the current immutable object by setting a value for the messager attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for messager
      Returns:
      A modified copy of the this object
    • withElement

      public final ImmutableReporter withElement(Element value)
      Copy the current immutable object by setting a present value for the optional element attribute.
      Specified by:
      withElement in class Reporter
      Parameters:
      value - The value for element
      Returns:
      A modified copy of this object
    • withElement

      public final ImmutableReporter withElement(com.google.common.base.Optional<? extends Element> optional)
      Copy the current immutable object by setting an optional value for the element attribute. A shallow reference equality check on the optional value is used to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for element
      Returns:
      A modified copy of this object
    • withAnnotation

      public final ImmutableReporter withAnnotation(AnnotationMirror value)
      Copy the current immutable object by setting a present value for the optional annotation attribute.
      Specified by:
      withAnnotation in class Reporter
      Parameters:
      value - The value for annotation
      Returns:
      A modified copy of this object
    • withAnnotation

      public final ImmutableReporter withAnnotation(com.google.common.base.Optional<? extends AnnotationMirror> optional)
      Copy the current immutable object by setting an optional value for the annotation attribute. A shallow reference equality check on the optional value is used to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for annotation
      Returns:
      A modified copy of this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableReporter that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • equalTo

      private boolean equalTo(int synthetic, ImmutableReporter another)
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: messager, element, annotation.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value Reporter with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • of

      public static ImmutableReporter of(Messager messager)
      Construct a new immutable Reporter instance.
      Parameters:
      messager - The value for the messager attribute
      Returns:
      An immutable Reporter instance
    • copyOf

      public static ImmutableReporter copyOf(Reporter instance)
      Creates an immutable copy of a Reporter value. 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