Package com.spotify.github.v3.issues
Class ImmutableEvent.Builder
- java.lang.Object
-
- com.spotify.github.v3.issues.ImmutableEvent.Builder
-
- Enclosing class:
- ImmutableEvent
@NotThreadSafe public static final class ImmutableEvent.Builder extends Object
Builds instances of typeImmutableEvent. 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 ImmutableEvent.Builderactor(User actor)Initializes the value for theactorattribute.ImmutableEventbuild()Builds a newImmutableEvent.ImmutableEvent.BuildercommitId(String commitId)Initializes the value for thecommitIdattribute.ImmutableEvent.BuildercommitUrl(URI commitUrl)Initializes the value for thecommitUrlattribute.ImmutableEvent.BuildercreatedAt(GitHubInstant createdAt)Initializes the value for thecreatedAtattribute.ImmutableEvent.Builderevent(String event)Initializes the value for theeventattribute.ImmutableEvent.Builderfrom(Event instance)Fill a builder with attribute values from the providedEventinstance.ImmutableEvent.Builderid(Integer id)Initializes the value for theidattribute.ImmutableEvent.Builderissue(Issue issue)Initializes the optional valueissueto issue.ImmutableEvent.Builderissue(Optional<? extends Issue> issue)Initializes the optional valueissueto issue.ImmutableEvent.Builderurl(URI url)Initializes the value for theurlattribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableEvent.Builder from(Event instance)
Fill a builder with attribute values from the providedEventinstance. 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
-
id
@CanIgnoreReturnValue public final ImmutableEvent.Builder id(@Nullable Integer id)
Initializes the value for theidattribute.- Parameters:
id- The value for id (can benull)- Returns:
thisbuilder for use in a chained invocation
-
url
@CanIgnoreReturnValue public final ImmutableEvent.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
-
actor
@CanIgnoreReturnValue public final ImmutableEvent.Builder actor(@Nullable User actor)
Initializes the value for theactorattribute.- Parameters:
actor- The value for actor (can benull)- Returns:
thisbuilder for use in a chained invocation
-
event
@CanIgnoreReturnValue public final ImmutableEvent.Builder event(@Nullable String event)
Initializes the value for theeventattribute.- Parameters:
event- The value for event (can benull)- Returns:
thisbuilder for use in a chained invocation
-
commitId
@CanIgnoreReturnValue public final ImmutableEvent.Builder commitId(@Nullable String commitId)
Initializes the value for thecommitIdattribute.- Parameters:
commitId- The value for commitId (can benull)- Returns:
thisbuilder for use in a chained invocation
-
commitUrl
@CanIgnoreReturnValue public final ImmutableEvent.Builder commitUrl(@Nullable URI commitUrl)
Initializes the value for thecommitUrlattribute.- Parameters:
commitUrl- The value for commitUrl (can benull)- Returns:
thisbuilder for use in a chained invocation
-
createdAt
@CanIgnoreReturnValue public final ImmutableEvent.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
-
issue
@CanIgnoreReturnValue public final ImmutableEvent.Builder issue(Issue issue)
Initializes the optional valueissueto issue.- Parameters:
issue- The value for issue- Returns:
thisbuilder for chained invocation
-
issue
@CanIgnoreReturnValue public final ImmutableEvent.Builder issue(Optional<? extends Issue> issue)
Initializes the optional valueissueto issue.- Parameters:
issue- The value for issue- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableEvent build()
Builds a newImmutableEvent.- Returns:
- An immutable instance of Event
- Throws:
IllegalStateException- if any required attributes are missing
-
-