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.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 ImmutableWebhook.Builder
active(Boolean active)
Initializes the value for theactive
attribute.ImmutableWebhook.Builder
addAllEvents(Iterable<String> elements)
Adds elements toevents
list.ImmutableWebhook.Builder
addEvents(String element)
Adds one element toevents
list.ImmutableWebhook.Builder
addEvents(String... elements)
Adds elements toevents
list.ImmutableWebhook
build()
Builds a newImmutableWebhook
.ImmutableWebhook.Builder
config(WebhookConfig config)
Initializes the value for theconfig
attribute.ImmutableWebhook.Builder
createdAt(GitHubInstant createdAt)
Initializes the value for thecreatedAt
attribute.ImmutableWebhook.Builder
events(Iterable<String> elements)
Sets or replaces all elements forevents
list.ImmutableWebhook.Builder
from(UpdateTracking instance)
Fill a builder with attribute values from the providedcom.spotify.github.UpdateTracking
instance.ImmutableWebhook.Builder
from(Webhook instance)
Fill a builder with attribute values from the providedcom.spotify.github.v3.hooks.Webhook
instance.ImmutableWebhook.Builder
id(Integer id)
Initializes the value for theid
attribute.ImmutableWebhook.Builder
name(String name)
Initializes the value for thename
attribute.ImmutableWebhook.Builder
pingUrl(URI pingUrl)
Initializes the value for thepingUrl
attribute.ImmutableWebhook.Builder
testUrl(URI testUrl)
Initializes the value for thetestUrl
attribute.ImmutableWebhook.Builder
updatedAt(GitHubInstant updatedAt)
Initializes the value for theupdatedAt
attribute.ImmutableWebhook.Builder
url(URI url)
Initializes the value for theurl
attribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableWebhook.Builder from(Webhook instance)
Fill a builder with attribute values from the providedcom.spotify.github.v3.hooks.Webhook
instance.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder 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.UpdateTracking
instance.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
createdAt
@CanIgnoreReturnValue public final ImmutableWebhook.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
-
updatedAt
@CanIgnoreReturnValue public final ImmutableWebhook.Builder updatedAt(@Nullable GitHubInstant updatedAt)
Initializes the value for theupdatedAt
attribute.- Parameters:
updatedAt
- The value for updatedAt (can benull
)- Returns:
this
builder for use in a chained invocation
-
id
@CanIgnoreReturnValue public final ImmutableWebhook.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 ImmutableWebhook.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
-
testUrl
@CanIgnoreReturnValue public final ImmutableWebhook.Builder testUrl(@Nullable URI testUrl)
Initializes the value for thetestUrl
attribute.- Parameters:
testUrl
- The value for testUrl (can benull
)- Returns:
this
builder for use in a chained invocation
-
pingUrl
@CanIgnoreReturnValue public final ImmutableWebhook.Builder pingUrl(@Nullable URI pingUrl)
Initializes the value for thepingUrl
attribute.- Parameters:
pingUrl
- The value for pingUrl (can benull
)- Returns:
this
builder for use in a chained invocation
-
name
@CanIgnoreReturnValue public final ImmutableWebhook.Builder name(@Nullable String name)
Initializes the value for thename
attribute.- Parameters:
name
- The value for name (can benull
)- Returns:
this
builder for use in a chained invocation
-
addEvents
@CanIgnoreReturnValue public final ImmutableWebhook.Builder addEvents(String element)
Adds one element toevents
list.- Parameters:
element
- A events element- Returns:
this
builder for use in a chained invocation
-
addEvents
@CanIgnoreReturnValue public final ImmutableWebhook.Builder addEvents(String... elements)
Adds elements toevents
list.- Parameters:
elements
- An array of events elements- Returns:
this
builder for use in a chained invocation
-
events
@CanIgnoreReturnValue public final ImmutableWebhook.Builder events(@Nullable Iterable<String> elements)
Sets or replaces all elements forevents
list.- Parameters:
elements
- An iterable of events elements- Returns:
this
builder for use in a chained invocation
-
addAllEvents
@CanIgnoreReturnValue public final ImmutableWebhook.Builder addAllEvents(Iterable<String> elements)
Adds elements toevents
list.- Parameters:
elements
- An iterable of events elements- Returns:
this
builder for use in a chained invocation
-
active
@CanIgnoreReturnValue public final ImmutableWebhook.Builder active(@Nullable Boolean active)
Initializes the value for theactive
attribute.- Parameters:
active
- The value for active (can benull
)- Returns:
this
builder for use in a chained invocation
-
config
@CanIgnoreReturnValue public final ImmutableWebhook.Builder config(@Nullable WebhookConfig config)
Initializes the value for theconfig
attribute.- Parameters:
config
- The value for config (can benull
)- Returns:
this
builder 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
-
-