Package com.spotify.github.v3.checks
Class ImmutableAnnotation.Builder
- java.lang.Object
-
- com.spotify.github.v3.checks.ImmutableAnnotation.Builder
-
- Enclosing class:
- ImmutableAnnotation
@NotThreadSafe public static final class ImmutableAnnotation.Builder extends Object
Builds instances of typeImmutableAnnotation
. Initialize attributes and then invoke thebuild()
method to create an immutable instance.Builder
is not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ImmutableAnnotation.Builder
annotationLevel(AnnotationLevel annotationLevel)
Initializes the value for theannotationLevel
attribute.ImmutableAnnotation.Builder
blobHref(String blobHref)
Initializes the optional valueblobHref
to blobHref.ImmutableAnnotation.Builder
blobHref(Optional<String> blobHref)
Initializes the optional valueblobHref
to blobHref.ImmutableAnnotation
build()
Builds a newImmutableAnnotation
.ImmutableAnnotation.Builder
endColumn(int endColumn)
Initializes the optional valueendColumn
to endColumn.ImmutableAnnotation.Builder
endColumn(Optional<Integer> endColumn)
Initializes the optional valueendColumn
to endColumn.ImmutableAnnotation.Builder
endLine(int endLine)
Initializes the value for theendLine
attribute.ImmutableAnnotation.Builder
from(Annotation instance)
Fill a builder with attribute values from the providedAnnotation
instance.ImmutableAnnotation.Builder
message(String message)
Initializes the value for themessage
attribute.ImmutableAnnotation.Builder
path(String path)
Initializes the value for thepath
attribute.ImmutableAnnotation.Builder
rawDetails(String rawDetails)
Initializes the optional valuerawDetails
to rawDetails.ImmutableAnnotation.Builder
rawDetails(Optional<String> rawDetails)
Initializes the optional valuerawDetails
to rawDetails.ImmutableAnnotation.Builder
startColumn(int startColumn)
Initializes the optional valuestartColumn
to startColumn.ImmutableAnnotation.Builder
startColumn(Optional<Integer> startColumn)
Initializes the optional valuestartColumn
to startColumn.ImmutableAnnotation.Builder
startLine(int startLine)
Initializes the value for thestartLine
attribute.ImmutableAnnotation.Builder
title(String title)
Initializes the optional valuetitle
to title.ImmutableAnnotation.Builder
title(Optional<String> title)
Initializes the optional valuetitle
to title.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableAnnotation.Builder from(Annotation instance)
Fill a builder with attribute values from the providedAnnotation
instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
path
@CanIgnoreReturnValue public final ImmutableAnnotation.Builder path(String path)
Initializes the value for thepath
attribute.- Parameters:
path
- The value for path- Returns:
this
builder for use in a chained invocation
-
blobHref
@CanIgnoreReturnValue public final ImmutableAnnotation.Builder blobHref(String blobHref)
Initializes the optional valueblobHref
to blobHref.- Parameters:
blobHref
- The value for blobHref- Returns:
this
builder for chained invocation
-
blobHref
@CanIgnoreReturnValue public final ImmutableAnnotation.Builder blobHref(Optional<String> blobHref)
Initializes the optional valueblobHref
to blobHref.- Parameters:
blobHref
- The value for blobHref- Returns:
this
builder for use in a chained invocation
-
annotationLevel
@CanIgnoreReturnValue public final ImmutableAnnotation.Builder annotationLevel(AnnotationLevel annotationLevel)
Initializes the value for theannotationLevel
attribute.- Parameters:
annotationLevel
- The value for annotationLevel- Returns:
this
builder for use in a chained invocation
-
message
@CanIgnoreReturnValue public final ImmutableAnnotation.Builder message(String message)
Initializes the value for themessage
attribute.- Parameters:
message
- The value for message- Returns:
this
builder for use in a chained invocation
-
title
@CanIgnoreReturnValue public final ImmutableAnnotation.Builder title(String title)
Initializes the optional valuetitle
to title.- Parameters:
title
- The value for title- Returns:
this
builder for chained invocation
-
title
@CanIgnoreReturnValue public final ImmutableAnnotation.Builder title(Optional<String> title)
Initializes the optional valuetitle
to title.- Parameters:
title
- The value for title- Returns:
this
builder for use in a chained invocation
-
rawDetails
@CanIgnoreReturnValue public final ImmutableAnnotation.Builder rawDetails(String rawDetails)
Initializes the optional valuerawDetails
to rawDetails.- Parameters:
rawDetails
- The value for rawDetails- Returns:
this
builder for chained invocation
-
rawDetails
@CanIgnoreReturnValue public final ImmutableAnnotation.Builder rawDetails(Optional<String> rawDetails)
Initializes the optional valuerawDetails
to rawDetails.- Parameters:
rawDetails
- The value for rawDetails- Returns:
this
builder for use in a chained invocation
-
startLine
@CanIgnoreReturnValue public final ImmutableAnnotation.Builder startLine(int startLine)
Initializes the value for thestartLine
attribute.- Parameters:
startLine
- The value for startLine- Returns:
this
builder for use in a chained invocation
-
endLine
@CanIgnoreReturnValue public final ImmutableAnnotation.Builder endLine(int endLine)
Initializes the value for theendLine
attribute.- Parameters:
endLine
- The value for endLine- Returns:
this
builder for use in a chained invocation
-
startColumn
@CanIgnoreReturnValue public final ImmutableAnnotation.Builder startColumn(int startColumn)
Initializes the optional valuestartColumn
to startColumn.- Parameters:
startColumn
- The value for startColumn- Returns:
this
builder for chained invocation
-
startColumn
@CanIgnoreReturnValue public final ImmutableAnnotation.Builder startColumn(Optional<Integer> startColumn)
Initializes the optional valuestartColumn
to startColumn.- Parameters:
startColumn
- The value for startColumn- Returns:
this
builder for use in a chained invocation
-
endColumn
@CanIgnoreReturnValue public final ImmutableAnnotation.Builder endColumn(int endColumn)
Initializes the optional valueendColumn
to endColumn.- Parameters:
endColumn
- The value for endColumn- Returns:
this
builder for chained invocation
-
endColumn
@CanIgnoreReturnValue public final ImmutableAnnotation.Builder endColumn(Optional<Integer> endColumn)
Initializes the optional valueendColumn
to endColumn.- Parameters:
endColumn
- The value for endColumn- Returns:
this
builder for use in a chained invocation
-
build
public ImmutableAnnotation build()
Builds a newImmutableAnnotation
.- Returns:
- An immutable instance of Annotation
- Throws:
IllegalStateException
- if any required attributes are missing
-
-