Class ImmutableAnnotation

  • All Implemented Interfaces:
    Annotation

    @ParametersAreNonnullByDefault
    @Generated("org.immutables.processor.ProxyProcessor")
    @Immutable
    @CheckReturnValue
    public final class ImmutableAnnotation
    extends Object
    implements Annotation
    Immutable implementation of Annotation.

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

    • Method Detail

      • path

        public String path()
        The path of the file to add an annotation to. For example, assets/css/main.css.
        Specified by:
        path in interface Annotation
        Returns:
        the string
      • annotationLevel

        public AnnotationLevel annotationLevel()
        Annotation level. Can be one of notice, warning, or failure.
        Specified by:
        annotationLevel in interface Annotation
        Returns:
        the annotation level
      • message

        public String message()
        A short description of the feedback for these lines of code. The maximum size is 64 KB.
        Specified by:
        message in interface Annotation
        Returns:
        the string
      • title

        public Optional<String> title()
        The title that represents the annotation. The maximum size is 255 characters.
        Specified by:
        title in interface Annotation
        Returns:
        the optional
      • rawDetails

        public Optional<String> rawDetails()
        Details about this annotation. The maximum size is 64 KB.
        Specified by:
        rawDetails in interface Annotation
        Returns:
        the optional string
      • startLine

        public int startLine()
        The start line of the annotation.
        Specified by:
        startLine in interface Annotation
        Returns:
        the int
      • endLine

        public int endLine()
        The end line of the annotation.
        Specified by:
        endLine in interface Annotation
        Returns:
        the int
      • withPath

        public final ImmutableAnnotation withPath​(String value)
        Copy the current immutable object by setting a value for the path attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for path
        Returns:
        A modified copy of the this object
      • withBlobHref

        public final ImmutableAnnotation withBlobHref​(String value)
        Copy the current immutable object by setting a present value for the optional blobHref attribute.
        Parameters:
        value - The value for blobHref
        Returns:
        A modified copy of this object
      • withBlobHref

        public final ImmutableAnnotation withBlobHref​(Optional<String> optional)
        Copy the current immutable object by setting an optional value for the blobHref attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
        Parameters:
        optional - A value for blobHref
        Returns:
        A modified copy of this object
      • withAnnotationLevel

        public final ImmutableAnnotation withAnnotationLevel​(AnnotationLevel value)
        Copy the current immutable object by setting a value for the annotationLevel attribute. A value equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for annotationLevel
        Returns:
        A modified copy of the this object
      • withMessage

        public final ImmutableAnnotation withMessage​(String value)
        Copy the current immutable object by setting a value for the message attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for message
        Returns:
        A modified copy of the this object
      • withTitle

        public final ImmutableAnnotation withTitle​(String value)
        Copy the current immutable object by setting a present value for the optional title attribute.
        Parameters:
        value - The value for title
        Returns:
        A modified copy of this object
      • withTitle

        public final ImmutableAnnotation withTitle​(Optional<String> optional)
        Copy the current immutable object by setting an optional value for the title attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
        Parameters:
        optional - A value for title
        Returns:
        A modified copy of this object
      • withRawDetails

        public final ImmutableAnnotation withRawDetails​(String value)
        Copy the current immutable object by setting a present value for the optional rawDetails attribute.
        Parameters:
        value - The value for rawDetails
        Returns:
        A modified copy of this object
      • withRawDetails

        public final ImmutableAnnotation withRawDetails​(Optional<String> optional)
        Copy the current immutable object by setting an optional value for the rawDetails attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
        Parameters:
        optional - A value for rawDetails
        Returns:
        A modified copy of this object
      • withStartLine

        public final ImmutableAnnotation withStartLine​(int value)
        Copy the current immutable object by setting a value for the startLine attribute. A value equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for startLine
        Returns:
        A modified copy of the this object
      • withEndLine

        public final ImmutableAnnotation withEndLine​(int value)
        Copy the current immutable object by setting a value for the endLine attribute. A value equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for endLine
        Returns:
        A modified copy of the this object
      • withStartColumn

        public final ImmutableAnnotation withStartColumn​(int value)
        Copy the current immutable object by setting a present value for the optional startColumn attribute.
        Parameters:
        value - The value for startColumn
        Returns:
        A modified copy of this object
      • withStartColumn

        public final ImmutableAnnotation withStartColumn​(Optional<Integer> optional)
        Copy the current immutable object by setting an optional value for the startColumn attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
        Parameters:
        optional - A value for startColumn
        Returns:
        A modified copy of this object
      • withEndColumn

        public final ImmutableAnnotation withEndColumn​(int value)
        Copy the current immutable object by setting a present value for the optional endColumn attribute.
        Parameters:
        value - The value for endColumn
        Returns:
        A modified copy of this object
      • withEndColumn

        public final ImmutableAnnotation withEndColumn​(Optional<Integer> optional)
        Copy the current immutable object by setting an optional value for the endColumn attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
        Parameters:
        optional - A value for endColumn
        Returns:
        A modified copy of this object
      • equals

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

        public int hashCode()
        Computes a hash code from attributes: path, blobHref, annotationLevel, message, title, rawDetails, startLine, endLine, startColumn, endColumn.
        Overrides:
        hashCode in class Object
        Returns:
        hashCode value
      • toString

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

        public static ImmutableAnnotation copyOf​(Annotation instance)
        Creates an immutable copy of a Annotation 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 Annotation instance