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.Builderis 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.BuilderannotationLevel(AnnotationLevel annotationLevel)Initializes the value for theannotationLevelattribute.ImmutableAnnotation.BuilderblobHref(String blobHref)Initializes the optional valueblobHrefto blobHref.ImmutableAnnotation.BuilderblobHref(Optional<String> blobHref)Initializes the optional valueblobHrefto blobHref.ImmutableAnnotationbuild()Builds a newImmutableAnnotation.ImmutableAnnotation.BuilderendColumn(int endColumn)Initializes the optional valueendColumnto endColumn.ImmutableAnnotation.BuilderendColumn(Optional<Integer> endColumn)Initializes the optional valueendColumnto endColumn.ImmutableAnnotation.BuilderendLine(int endLine)Initializes the value for theendLineattribute.ImmutableAnnotation.Builderfrom(Annotation instance)Fill a builder with attribute values from the providedAnnotationinstance.ImmutableAnnotation.Buildermessage(String message)Initializes the value for themessageattribute.ImmutableAnnotation.Builderpath(String path)Initializes the value for thepathattribute.ImmutableAnnotation.BuilderrawDetails(String rawDetails)Initializes the optional valuerawDetailsto rawDetails.ImmutableAnnotation.BuilderrawDetails(Optional<String> rawDetails)Initializes the optional valuerawDetailsto rawDetails.ImmutableAnnotation.BuilderstartColumn(int startColumn)Initializes the optional valuestartColumnto startColumn.ImmutableAnnotation.BuilderstartColumn(Optional<Integer> startColumn)Initializes the optional valuestartColumnto startColumn.ImmutableAnnotation.BuilderstartLine(int startLine)Initializes the value for thestartLineattribute.ImmutableAnnotation.Buildertitle(String title)Initializes the optional valuetitleto title.ImmutableAnnotation.Buildertitle(Optional<String> title)Initializes the optional valuetitleto title.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableAnnotation.Builder from(Annotation instance)
Fill a builder with attribute values from the providedAnnotationinstance. 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:
thisbuilder for use in a chained invocation
-
path
@CanIgnoreReturnValue public final ImmutableAnnotation.Builder path(String path)
Initializes the value for thepathattribute.- Parameters:
path- The value for path- Returns:
thisbuilder for use in a chained invocation
-
blobHref
@CanIgnoreReturnValue public final ImmutableAnnotation.Builder blobHref(String blobHref)
Initializes the optional valueblobHrefto blobHref.- Parameters:
blobHref- The value for blobHref- Returns:
thisbuilder for chained invocation
-
blobHref
@CanIgnoreReturnValue public final ImmutableAnnotation.Builder blobHref(Optional<String> blobHref)
Initializes the optional valueblobHrefto blobHref.- Parameters:
blobHref- The value for blobHref- Returns:
thisbuilder for use in a chained invocation
-
annotationLevel
@CanIgnoreReturnValue public final ImmutableAnnotation.Builder annotationLevel(AnnotationLevel annotationLevel)
Initializes the value for theannotationLevelattribute.- Parameters:
annotationLevel- The value for annotationLevel- Returns:
thisbuilder for use in a chained invocation
-
message
@CanIgnoreReturnValue public final ImmutableAnnotation.Builder message(String message)
Initializes the value for themessageattribute.- Parameters:
message- The value for message- Returns:
thisbuilder for use in a chained invocation
-
title
@CanIgnoreReturnValue public final ImmutableAnnotation.Builder title(String title)
Initializes the optional valuetitleto title.- Parameters:
title- The value for title- Returns:
thisbuilder for chained invocation
-
title
@CanIgnoreReturnValue public final ImmutableAnnotation.Builder title(Optional<String> title)
Initializes the optional valuetitleto title.- Parameters:
title- The value for title- Returns:
thisbuilder for use in a chained invocation
-
rawDetails
@CanIgnoreReturnValue public final ImmutableAnnotation.Builder rawDetails(String rawDetails)
Initializes the optional valuerawDetailsto rawDetails.- Parameters:
rawDetails- The value for rawDetails- Returns:
thisbuilder for chained invocation
-
rawDetails
@CanIgnoreReturnValue public final ImmutableAnnotation.Builder rawDetails(Optional<String> rawDetails)
Initializes the optional valuerawDetailsto rawDetails.- Parameters:
rawDetails- The value for rawDetails- Returns:
thisbuilder for use in a chained invocation
-
startLine
@CanIgnoreReturnValue public final ImmutableAnnotation.Builder startLine(int startLine)
Initializes the value for thestartLineattribute.- Parameters:
startLine- The value for startLine- Returns:
thisbuilder for use in a chained invocation
-
endLine
@CanIgnoreReturnValue public final ImmutableAnnotation.Builder endLine(int endLine)
Initializes the value for theendLineattribute.- Parameters:
endLine- The value for endLine- Returns:
thisbuilder for use in a chained invocation
-
startColumn
@CanIgnoreReturnValue public final ImmutableAnnotation.Builder startColumn(int startColumn)
Initializes the optional valuestartColumnto startColumn.- Parameters:
startColumn- The value for startColumn- Returns:
thisbuilder for chained invocation
-
startColumn
@CanIgnoreReturnValue public final ImmutableAnnotation.Builder startColumn(Optional<Integer> startColumn)
Initializes the optional valuestartColumnto startColumn.- Parameters:
startColumn- The value for startColumn- Returns:
thisbuilder for use in a chained invocation
-
endColumn
@CanIgnoreReturnValue public final ImmutableAnnotation.Builder endColumn(int endColumn)
Initializes the optional valueendColumnto endColumn.- Parameters:
endColumn- The value for endColumn- Returns:
thisbuilder for chained invocation
-
endColumn
@CanIgnoreReturnValue public final ImmutableAnnotation.Builder endColumn(Optional<Integer> endColumn)
Initializes the optional valueendColumnto endColumn.- Parameters:
endColumn- The value for endColumn- Returns:
thisbuilder 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
-
-