Package com.spotify.github.v3.comment
Class ImmutableComment.Builder
- java.lang.Object
-
- com.spotify.github.v3.comment.ImmutableComment.Builder
-
- Enclosing class:
- ImmutableComment
@NotThreadSafe public static final class ImmutableComment.Builder extends Object
Builds instances of typeImmutableComment. 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 Deprecated Methods Modifier and Type Method Description ImmutableComment.Builderbody(String body)Initializes the value for thebodyattribute.ImmutableCommentbuild()Builds a newImmutableComment.ImmutableComment.BuildercommitId(String commitId)Initializes the optional valuecommitIdto commitId.ImmutableComment.BuildercommitId(Optional<String> commitId)Initializes the optional valuecommitIdto commitId.ImmutableComment.BuildercreatedAt(GitHubInstant createdAt)Initializes the value for thecreatedAtattribute.ImmutableComment.Builderfrom(UpdateTracking instance)Fill a builder with attribute values from the providedcom.spotify.github.UpdateTrackinginstance.ImmutableComment.Builderfrom(Comment instance)Fill a builder with attribute values from the providedcom.spotify.github.v3.comment.Commentinstance.ImmutableComment.BuilderhtmlUrl(URI htmlUrl)Initializes the value for thehtmlUrlattribute.ImmutableComment.Builderid(Long id)Initializes the value for theidattribute.ImmutableComment.BuilderissueUrl(URI issueUrl)Initializes the optional valueissueUrlto issueUrl.ImmutableComment.BuilderissueUrl(Optional<? extends URI> issueUrl)Initializes the optional valueissueUrlto issueUrl.ImmutableComment.Builderline(int line)Deprecated.ImmutableComment.Builderline(Optional<Integer> line)Deprecated.ImmutableComment.Builderpath(String path)Initializes the optional valuepathto path.ImmutableComment.Builderpath(Optional<String> path)Initializes the optional valuepathto path.ImmutableComment.Builderposition(int position)Initializes the optional valuepositionto position.ImmutableComment.Builderposition(Optional<Integer> position)Initializes the optional valuepositionto position.ImmutableComment.BuilderupdatedAt(GitHubInstant updatedAt)Initializes the value for theupdatedAtattribute.ImmutableComment.Builderurl(URI url)Initializes the value for theurlattribute.ImmutableComment.Builderuser(User user)Initializes the value for theuserattribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableComment.Builder from(Comment instance)
Fill a builder with attribute values from the providedcom.spotify.github.v3.comment.Commentinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
from
@CanIgnoreReturnValue public final ImmutableComment.Builder from(UpdateTracking instance)
Fill a builder with attribute values from the providedcom.spotify.github.UpdateTrackinginstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
createdAt
@CanIgnoreReturnValue public final ImmutableComment.Builder createdAt(@Nullable GitHubInstant createdAt)
Initializes the value for thecreatedAtattribute.- Parameters:
createdAt- The value for createdAt (can benull)- Returns:
thisbuilder for use in a chained invocation
-
updatedAt
@CanIgnoreReturnValue public final ImmutableComment.Builder updatedAt(@Nullable GitHubInstant updatedAt)
Initializes the value for theupdatedAtattribute.- Parameters:
updatedAt- The value for updatedAt (can benull)- Returns:
thisbuilder for use in a chained invocation
-
url
@CanIgnoreReturnValue public final ImmutableComment.Builder url(@Nullable URI url)
Initializes the value for theurlattribute.- Parameters:
url- The value for url (can benull)- Returns:
thisbuilder for use in a chained invocation
-
htmlUrl
@CanIgnoreReturnValue public final ImmutableComment.Builder htmlUrl(@Nullable URI htmlUrl)
Initializes the value for thehtmlUrlattribute.- Parameters:
htmlUrl- The value for htmlUrl (can benull)- Returns:
thisbuilder for use in a chained invocation
-
id
@CanIgnoreReturnValue public final ImmutableComment.Builder id(Long id)
Initializes the value for theidattribute.- Parameters:
id- The value for id- Returns:
thisbuilder for use in a chained invocation
-
user
@CanIgnoreReturnValue public final ImmutableComment.Builder user(@Nullable User user)
Initializes the value for theuserattribute.- Parameters:
user- The value for user (can benull)- Returns:
thisbuilder for use in a chained invocation
-
position
@CanIgnoreReturnValue public final ImmutableComment.Builder position(int position)
Initializes the optional valuepositionto position.- Parameters:
position- The value for position- Returns:
thisbuilder for chained invocation
-
position
@CanIgnoreReturnValue public final ImmutableComment.Builder position(Optional<Integer> position)
Initializes the optional valuepositionto position.- Parameters:
position- The value for position- Returns:
thisbuilder for use in a chained invocation
-
line
@CanIgnoreReturnValue @Deprecated public final ImmutableComment.Builder line(int line)
Deprecated.Initializes the optional valuelineto line.- Parameters:
line- The value for line- Returns:
thisbuilder for chained invocation
-
line
@CanIgnoreReturnValue @Deprecated public final ImmutableComment.Builder line(Optional<Integer> line)
Deprecated.Initializes the optional valuelineto line.- Parameters:
line- The value for line- Returns:
thisbuilder for use in a chained invocation
-
path
@CanIgnoreReturnValue public final ImmutableComment.Builder path(String path)
Initializes the optional valuepathto path.- Parameters:
path- The value for path- Returns:
thisbuilder for chained invocation
-
path
@CanIgnoreReturnValue public final ImmutableComment.Builder path(Optional<String> path)
Initializes the optional valuepathto path.- Parameters:
path- The value for path- Returns:
thisbuilder for use in a chained invocation
-
commitId
@CanIgnoreReturnValue public final ImmutableComment.Builder commitId(String commitId)
Initializes the optional valuecommitIdto commitId.- Parameters:
commitId- The value for commitId- Returns:
thisbuilder for chained invocation
-
commitId
@CanIgnoreReturnValue public final ImmutableComment.Builder commitId(Optional<String> commitId)
Initializes the optional valuecommitIdto commitId.- Parameters:
commitId- The value for commitId- Returns:
thisbuilder for use in a chained invocation
-
body
@CanIgnoreReturnValue public final ImmutableComment.Builder body(@Nullable String body)
Initializes the value for thebodyattribute.- Parameters:
body- The value for body (can benull)- Returns:
thisbuilder for use in a chained invocation
-
issueUrl
@CanIgnoreReturnValue public final ImmutableComment.Builder issueUrl(URI issueUrl)
Initializes the optional valueissueUrlto issueUrl.- Parameters:
issueUrl- The value for issueUrl- Returns:
thisbuilder for chained invocation
-
issueUrl
@CanIgnoreReturnValue public final ImmutableComment.Builder issueUrl(Optional<? extends URI> issueUrl)
Initializes the optional valueissueUrlto issueUrl.- Parameters:
issueUrl- The value for issueUrl- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableComment build()
Builds a newImmutableComment.- Returns:
- An immutable instance of Comment
- Throws:
IllegalStateException- if any required attributes are missing
-
-