Class ImmutableRound


  • @ParametersAreNonnullByDefault
    @Generated("org.immutables.processor.ProxyProcessor")
    @Immutable
    public final class ImmutableRound
    extends Round
    Immutable implementation of Round.

    Use the builder to create immutable instances: ImmutableRound.builder().

    • 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
      • lazyInitBitmap

        private transient volatile long lazyInitBitmap
      • ENVIRONMENT_LAZY_INIT_BIT

        private static final long ENVIRONMENT_LAZY_INIT_BIT
        See Also:
        Constant Field Values
    • 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:
        processing in class Round
        Returns:
        The value of the processing attribute
      • round

        public javax.annotation.processing.RoundEnvironment round()
        Specified by:
        round in class Round
        Returns:
        The value of the round attribute
      • annotations

        public com.google.common.collect.ImmutableSet<javax.lang.model.element.TypeElement> annotations()
        Specified by:
        annotations in class Round
        Returns:
        The value of the annotations attribute
      • customImmutableAnnotations

        public com.google.common.collect.ImmutableSet<java.lang.String> customImmutableAnnotations()
        Specified by:
        customImmutableAnnotations in class Round
        Returns:
        The value of the customImmutableAnnotations attribute
      • withProcessing

        public final ImmutableRound withProcessing​(javax.annotation.processing.ProcessingEnvironment value)
        Copy the current immutable object by setting a value for the processing attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for processing
        Returns:
        A modified copy of the this object
      • withRound

        public final ImmutableRound withRound​(javax.annotation.processing.RoundEnvironment value)
        Copy the current immutable object by setting a value for the round attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for round
        Returns:
        A modified copy of the this object
      • withAnnotations

        public final ImmutableRound withAnnotations​(javax.lang.model.element.TypeElement... elements)
        Copy the current immutable object with elements that replace the content of annotations.
        Parameters:
        elements - The elements to set
        Returns:
        A modified copy of this object
      • 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 of annotations. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        elements - An iterable of annotations elements to set
        Returns:
        A modified copy of this object
      • withCustomImmutableAnnotations

        public final ImmutableRound withCustomImmutableAnnotations​(java.lang.String... elements)
        Copy the current immutable object with elements that replace the content of customImmutableAnnotations.
        Parameters:
        elements - The elements to set
        Returns:
        A modified copy of this object
      • withCustomImmutableAnnotations

        public final ImmutableRound withCustomImmutableAnnotations​(java.lang.Iterable<java.lang.String> elements)
        Copy the current immutable object with elements that replace the content of customImmutableAnnotations. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        elements - An iterable of customImmutableAnnotations elements to set
        Returns:
        A modified copy of this object
      • equals

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

        private boolean equalTo​(int synthetic,
                                ImmutableRound another)
      • hashCode

        public int hashCode()
        Computes a hash code from attributes: processing, round, annotations, customImmutableAnnotations, composer.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        hashCode value
      • toString

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

        public Proto.Environment environment()

        Returns a lazily initialized value of the environment attribute. 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:
        environment in class Round
        Returns:
        A lazily initialized value of the environment attribute
      • copyOf

        public static ImmutableRound copyOf​(Round instance)
        Creates an immutable copy of a Round 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 Round instance
      • builder

        public static ImmutableRound.Builder builder()
        Creates a builder for ImmutableRound.
         ImmutableRound.builder()
            .processing(javax.annotation.processing.ProcessingEnvironment) // required processing
            .round(javax.annotation.processing.RoundEnvironment) // required round
            .addAnnotations|addAllAnnotations(javax.lang.model.element.TypeElement) // annotations elements
            .addCustomImmutableAnnotations|addAllCustomImmutableAnnotations(String) // customImmutableAnnotations elements
            .build();
         
        Returns:
        A new ImmutableRound builder