Class 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

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private com.google.common.base.Optional<javax.lang.model.element.AnnotationMirror> annotation  
      private com.google.common.base.Optional<javax.lang.model.element.Element> element  
      private javax.annotation.processing.Messager messager  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private ImmutableReporter​(javax.annotation.processing.Messager messager)  
      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 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 ImmutableReporter copyOf​(Reporter instance)
      Creates an immutable copy of a Reporter value.
      (package private) com.google.common.base.Optional<javax.lang.model.element.Element> element()  
      boolean equals​(java.lang.Object another)
      This instance is equal to all instances of ImmutableReporter that have equal attribute values.
      private boolean equalTo​(int synthetic, ImmutableReporter another)  
      int hashCode()
      Computes a hash code from attributes: messager, element, annotation.
      (package private) javax.annotation.processing.Messager messager()  
      static ImmutableReporter of​(javax.annotation.processing.Messager messager)
      Construct a new immutable Reporter instance.
      java.lang.String toString()
      Prints the immutable value Reporter with attribute values.
      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 the annotation attribute.
      ImmutableReporter withAnnotation​(javax.lang.model.element.AnnotationMirror value)
      Copy the current immutable object by setting a present value for the optional annotation attribute.
      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 the element attribute.
      ImmutableReporter withElement​(javax.lang.model.element.Element value)
      Copy the current immutable object by setting a present value for the optional element attribute.
      ImmutableReporter withMessager​(javax.annotation.processing.Messager value)
      Copy the current immutable object by setting a value for the messager attribute.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • messager

        private final javax.annotation.processing.Messager messager
      • element

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

        private final com.google.common.base.Optional<javax.lang.model.element.AnnotationMirror> annotation
    • 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()
        Specified by:
        messager in class Reporter
        Returns:
        The value of the messager attribute
      • element

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

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

        public final ImmutableReporter withMessager​(javax.annotation.processing.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​(javax.lang.model.element.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 javax.lang.model.element.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​(javax.lang.model.element.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 javax.lang.model.element.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
                              java.lang.Object another)
        This instance is equal to all instances of ImmutableReporter that have equal attribute values.
        Overrides:
        equals in class java.lang.Object
        Returns:
        true if this is equal to another instance
      • hashCode

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

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

        public static ImmutableReporter of​(javax.annotation.processing.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