Package com.spotify.github.v3.hooks
Class ImmutableWebhook.Builder
- java.lang.Object
-
- com.spotify.github.v3.hooks.ImmutableWebhook.Builder
-
- Enclosing class:
- ImmutableWebhook
@NotThreadSafe public static final class ImmutableWebhook.Builder extends Object
Builds instances of typeImmutableWebhook. 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 ImmutableWebhook.Builderactive(Boolean active)Initializes the value for theactiveattribute.ImmutableWebhook.BuilderaddAllEvents(Iterable<String> elements)Adds elements toeventslist.ImmutableWebhook.BuilderaddEvents(String element)Adds one element toeventslist.ImmutableWebhook.BuilderaddEvents(String... elements)Adds elements toeventslist.ImmutableWebhookbuild()Builds a newImmutableWebhook.ImmutableWebhook.Builderconfig(WebhookConfig config)Initializes the value for theconfigattribute.ImmutableWebhook.BuildercreatedAt(GitHubInstant createdAt)Initializes the value for thecreatedAtattribute.ImmutableWebhook.Builderevents(Iterable<String> elements)Sets or replaces all elements foreventslist.ImmutableWebhook.Builderfrom(UpdateTracking instance)Fill a builder with attribute values from the providedcom.spotify.github.UpdateTrackinginstance.ImmutableWebhook.Builderfrom(Webhook instance)Fill a builder with attribute values from the providedcom.spotify.github.v3.hooks.Webhookinstance.ImmutableWebhook.Builderid(Integer id)Initializes the value for theidattribute.ImmutableWebhook.Buildername(String name)Initializes the value for thenameattribute.ImmutableWebhook.BuilderpingUrl(URI pingUrl)Initializes the value for thepingUrlattribute.ImmutableWebhook.BuildertestUrl(URI testUrl)Initializes the value for thetestUrlattribute.ImmutableWebhook.BuilderupdatedAt(GitHubInstant updatedAt)Initializes the value for theupdatedAtattribute.ImmutableWebhook.Builderurl(URI url)Initializes the value for theurlattribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableWebhook.Builder from(Webhook instance)
Fill a builder with attribute values from the providedcom.spotify.github.v3.hooks.Webhookinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
from
@CanIgnoreReturnValue public final ImmutableWebhook.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 ImmutableWebhook.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 ImmutableWebhook.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
-
id
@CanIgnoreReturnValue public final ImmutableWebhook.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 ImmutableWebhook.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
-
testUrl
@CanIgnoreReturnValue public final ImmutableWebhook.Builder testUrl(@Nullable URI testUrl)
Initializes the value for thetestUrlattribute.- Parameters:
testUrl- The value for testUrl (can benull)- Returns:
thisbuilder for use in a chained invocation
-
pingUrl
@CanIgnoreReturnValue public final ImmutableWebhook.Builder pingUrl(@Nullable URI pingUrl)
Initializes the value for thepingUrlattribute.- Parameters:
pingUrl- The value for pingUrl (can benull)- Returns:
thisbuilder for use in a chained invocation
-
name
@CanIgnoreReturnValue public final ImmutableWebhook.Builder name(@Nullable String name)
Initializes the value for thenameattribute.- Parameters:
name- The value for name (can benull)- Returns:
thisbuilder for use in a chained invocation
-
addEvents
@CanIgnoreReturnValue public final ImmutableWebhook.Builder addEvents(String element)
Adds one element toeventslist.- Parameters:
element- A events element- Returns:
thisbuilder for use in a chained invocation
-
addEvents
@CanIgnoreReturnValue public final ImmutableWebhook.Builder addEvents(String... elements)
Adds elements toeventslist.- Parameters:
elements- An array of events elements- Returns:
thisbuilder for use in a chained invocation
-
events
@CanIgnoreReturnValue public final ImmutableWebhook.Builder events(@Nullable Iterable<String> elements)
Sets or replaces all elements foreventslist.- Parameters:
elements- An iterable of events elements- Returns:
thisbuilder for use in a chained invocation
-
addAllEvents
@CanIgnoreReturnValue public final ImmutableWebhook.Builder addAllEvents(Iterable<String> elements)
Adds elements toeventslist.- Parameters:
elements- An iterable of events elements- Returns:
thisbuilder for use in a chained invocation
-
active
@CanIgnoreReturnValue public final ImmutableWebhook.Builder active(@Nullable Boolean active)
Initializes the value for theactiveattribute.- Parameters:
active- The value for active (can benull)- Returns:
thisbuilder for use in a chained invocation
-
config
@CanIgnoreReturnValue public final ImmutableWebhook.Builder config(@Nullable WebhookConfig config)
Initializes the value for theconfigattribute.- Parameters:
config- The value for config (can benull)- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableWebhook build()
Builds a newImmutableWebhook.- Returns:
- An immutable instance of Webhook
- Throws:
IllegalStateException- if any required attributes are missing
-
-