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.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 ImmutableEvent.Builder
actor(User actor)
Initializes the value for theactor
attribute.ImmutableEvent
build()
Builds a newImmutableEvent
.ImmutableEvent.Builder
commitId(String commitId)
Initializes the value for thecommitId
attribute.ImmutableEvent.Builder
commitUrl(URI commitUrl)
Initializes the value for thecommitUrl
attribute.ImmutableEvent.Builder
createdAt(GitHubInstant createdAt)
Initializes the value for thecreatedAt
attribute.ImmutableEvent.Builder
event(String event)
Initializes the value for theevent
attribute.ImmutableEvent.Builder
from(Event instance)
Fill a builder with attribute values from the providedEvent
instance.ImmutableEvent.Builder
id(Integer id)
Initializes the value for theid
attribute.ImmutableEvent.Builder
issue(Issue issue)
Initializes the optional valueissue
to issue.ImmutableEvent.Builder
issue(Optional<? extends Issue> issue)
Initializes the optional valueissue
to issue.ImmutableEvent.Builder
url(URI url)
Initializes the value for theurl
attribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableEvent.Builder from(Event instance)
Fill a builder with attribute values from the providedEvent
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
-
id
@CanIgnoreReturnValue public final ImmutableEvent.Builder id(@Nullable Integer id)
Initializes the value for theid
attribute.- Parameters:
id
- The value for id (can benull
)- Returns:
this
builder for use in a chained invocation
-
url
@CanIgnoreReturnValue public final ImmutableEvent.Builder url(@Nullable URI url)
Initializes the value for theurl
attribute.- Parameters:
url
- The value for url (can benull
)- Returns:
this
builder for use in a chained invocation
-
actor
@CanIgnoreReturnValue public final ImmutableEvent.Builder actor(@Nullable User actor)
Initializes the value for theactor
attribute.- Parameters:
actor
- The value for actor (can benull
)- Returns:
this
builder for use in a chained invocation
-
event
@CanIgnoreReturnValue public final ImmutableEvent.Builder event(@Nullable String event)
Initializes the value for theevent
attribute.- Parameters:
event
- The value for event (can benull
)- Returns:
this
builder for use in a chained invocation
-
commitId
@CanIgnoreReturnValue public final ImmutableEvent.Builder commitId(@Nullable String commitId)
Initializes the value for thecommitId
attribute.- Parameters:
commitId
- The value for commitId (can benull
)- Returns:
this
builder for use in a chained invocation
-
commitUrl
@CanIgnoreReturnValue public final ImmutableEvent.Builder commitUrl(@Nullable URI commitUrl)
Initializes the value for thecommitUrl
attribute.- Parameters:
commitUrl
- The value for commitUrl (can benull
)- Returns:
this
builder for use in a chained invocation
-
createdAt
@CanIgnoreReturnValue public final ImmutableEvent.Builder createdAt(@Nullable GitHubInstant createdAt)
Initializes the value for thecreatedAt
attribute.- Parameters:
createdAt
- The value for createdAt (can benull
)- Returns:
this
builder for use in a chained invocation
-
issue
@CanIgnoreReturnValue public final ImmutableEvent.Builder issue(Issue issue)
Initializes the optional valueissue
to issue.- Parameters:
issue
- The value for issue- Returns:
this
builder for chained invocation
-
issue
@CanIgnoreReturnValue public final ImmutableEvent.Builder issue(Optional<? extends Issue> issue)
Initializes the optional valueissue
to issue.- Parameters:
issue
- The value for issue- Returns:
this
builder 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
-
-