Package com.spotify.github.v3.checks
Class ImmutableAnnotation
- java.lang.Object
-
- com.spotify.github.v3.checks.ImmutableAnnotation
-
- All Implemented Interfaces:
Annotation
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableAnnotation extends Object implements Annotation
Immutable implementation ofAnnotation
.Use the builder to create immutable instances:
ImmutableAnnotation.builder()
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ImmutableAnnotation.Builder
Builds instances of typeImmutableAnnotation
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description AnnotationLevel
annotationLevel()
Annotation level.Optional<String>
blobHref()
Blob href optional.static ImmutableAnnotation.Builder
builder()
Creates a builder forImmutableAnnotation
.static ImmutableAnnotation
copyOf(Annotation instance)
Creates an immutable copy of aAnnotation
value.Optional<Integer>
endColumn()
End column optional.int
endLine()
The end line of the annotation.boolean
equals(Object another)
This instance is equal to all instances ofImmutableAnnotation
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:path
,blobHref
,annotationLevel
,message
,title
,rawDetails
,startLine
,endLine
,startColumn
,endColumn
.String
message()
A short description of the feedback for these lines of code.String
path()
The path of the file to add an annotation to.Optional<String>
rawDetails()
Details about this annotation.Optional<Integer>
startColumn()
Start column optional.int
startLine()
The start line of the annotation.Optional<String>
title()
The title that represents the annotation.String
toString()
Prints the immutable valueAnnotation
with attribute values.ImmutableAnnotation
withAnnotationLevel(AnnotationLevel value)
Copy the current immutable object by setting a value for theannotationLevel
attribute.ImmutableAnnotation
withBlobHref(String value)
Copy the current immutable object by setting a present value for the optionalblobHref
attribute.ImmutableAnnotation
withBlobHref(Optional<String> optional)
Copy the current immutable object by setting an optional value for theblobHref
attribute.ImmutableAnnotation
withEndColumn(int value)
Copy the current immutable object by setting a present value for the optionalendColumn
attribute.ImmutableAnnotation
withEndColumn(Optional<Integer> optional)
Copy the current immutable object by setting an optional value for theendColumn
attribute.ImmutableAnnotation
withEndLine(int value)
Copy the current immutable object by setting a value for theendLine
attribute.ImmutableAnnotation
withMessage(String value)
Copy the current immutable object by setting a value for themessage
attribute.ImmutableAnnotation
withPath(String value)
Copy the current immutable object by setting a value for thepath
attribute.ImmutableAnnotation
withRawDetails(String value)
Copy the current immutable object by setting a present value for the optionalrawDetails
attribute.ImmutableAnnotation
withRawDetails(Optional<String> optional)
Copy the current immutable object by setting an optional value for therawDetails
attribute.ImmutableAnnotation
withStartColumn(int value)
Copy the current immutable object by setting a present value for the optionalstartColumn
attribute.ImmutableAnnotation
withStartColumn(Optional<Integer> optional)
Copy the current immutable object by setting an optional value for thestartColumn
attribute.ImmutableAnnotation
withStartLine(int value)
Copy the current immutable object by setting a value for thestartLine
attribute.ImmutableAnnotation
withTitle(String value)
Copy the current immutable object by setting a present value for the optionaltitle
attribute.ImmutableAnnotation
withTitle(Optional<String> optional)
Copy the current immutable object by setting an optional value for thetitle
attribute.
-
-
-
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 interfaceAnnotation
- Returns:
- the string
-
blobHref
public Optional<String> blobHref()
Blob href optional.- Specified by:
blobHref
in interfaceAnnotation
- Returns:
- the optional
-
annotationLevel
public AnnotationLevel annotationLevel()
Annotation level. Can be one of notice, warning, or failure.- Specified by:
annotationLevel
in interfaceAnnotation
- 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 interfaceAnnotation
- Returns:
- the string
-
title
public Optional<String> title()
The title that represents the annotation. The maximum size is 255 characters.- Specified by:
title
in interfaceAnnotation
- Returns:
- the optional
-
rawDetails
public Optional<String> rawDetails()
Details about this annotation. The maximum size is 64 KB.- Specified by:
rawDetails
in interfaceAnnotation
- Returns:
- the optional string
-
startLine
public int startLine()
The start line of the annotation.- Specified by:
startLine
in interfaceAnnotation
- Returns:
- the int
-
endLine
public int endLine()
The end line of the annotation.- Specified by:
endLine
in interfaceAnnotation
- Returns:
- the int
-
startColumn
public Optional<Integer> startColumn()
Start column optional.- Specified by:
startColumn
in interfaceAnnotation
- Returns:
- the optional
-
endColumn
public Optional<Integer> endColumn()
End column optional.- Specified by:
endColumn
in interfaceAnnotation
- Returns:
- the optional
-
withPath
public final ImmutableAnnotation withPath(String value)
Copy the current immutable object by setting a value for thepath
attribute. An equals check used to prevent copying of the same value by returningthis
.- 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 optionalblobHref
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 theblobHref
attribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis
.- 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 theannotationLevel
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- 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 themessage
attribute. An equals check used to prevent copying of the same value by returningthis
.- 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 optionaltitle
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 thetitle
attribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis
.- 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 optionalrawDetails
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 therawDetails
attribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis
.- 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 thestartLine
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- 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 theendLine
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- 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 optionalstartColumn
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 thestartColumn
attribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis
.- 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 optionalendColumn
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 theendColumn
attribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis
.- 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 ofImmutableAnnotation
that have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:path
,blobHref
,annotationLevel
,message
,title
,rawDetails
,startLine
,endLine
,startColumn
,endColumn
.
-
toString
public String toString()
Prints the immutable valueAnnotation
with attribute values.
-
copyOf
public static ImmutableAnnotation copyOf(Annotation instance)
Creates an immutable copy of aAnnotation
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
-
builder
public static ImmutableAnnotation.Builder builder()
Creates a builder forImmutableAnnotation
.ImmutableAnnotation.builder() .path(String) // required
path
.blobHref(String) // optionalblobHref
.annotationLevel(com.spotify.github.v3.checks.AnnotationLevel) // requiredannotationLevel
.message(String) // requiredmessage
.title(String) // optionaltitle
.rawDetails(String) // optionalrawDetails
.startLine(int) // requiredstartLine
.endLine(int) // requiredendLine
.startColumn(Integer) // optionalstartColumn
.endColumn(Integer) // optionalendColumn
.build();- Returns:
- A new ImmutableAnnotation builder
-
-