Class ImmutableWebhookCreate.Builder
- java.lang.Object
-
- com.spotify.github.v3.hooks.requests.ImmutableWebhookCreate.Builder
-
- Enclosing class:
- ImmutableWebhookCreate
@NotThreadSafe public static final class ImmutableWebhookCreate.Builder extends Object
Builds instances of typeImmutableWebhookCreate
. 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 ImmutableWebhookCreate.Builder
active(Boolean active)
Initializes the value for theactive
attribute.ImmutableWebhookCreate.Builder
addAllEvents(Iterable<String> elements)
Adds elements toevents
list.ImmutableWebhookCreate.Builder
addEvents(String element)
Adds one element toevents
list.ImmutableWebhookCreate.Builder
addEvents(String... elements)
Adds elements toevents
list.ImmutableWebhookCreate
build()
Builds a newImmutableWebhookCreate
.ImmutableWebhookCreate.Builder
config(WebhookConfig config)
Initializes the value for theconfig
attribute.ImmutableWebhookCreate.Builder
events(Iterable<String> elements)
Sets or replaces all elements forevents
list.ImmutableWebhookCreate.Builder
from(WebhookCreate instance)
Fill a builder with attribute values from the providedWebhookCreate
instance.ImmutableWebhookCreate.Builder
name(String name)
Initializes the value for thename
attribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableWebhookCreate.Builder from(WebhookCreate instance)
Fill a builder with attribute values from the providedWebhookCreate
instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values. Collection elements and entries will be added, not replaced.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
name
@CanIgnoreReturnValue public final ImmutableWebhookCreate.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
-
active
@CanIgnoreReturnValue public final ImmutableWebhookCreate.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
-
addEvents
@CanIgnoreReturnValue public final ImmutableWebhookCreate.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 ImmutableWebhookCreate.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 ImmutableWebhookCreate.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 ImmutableWebhookCreate.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
-
config
@CanIgnoreReturnValue public final ImmutableWebhookCreate.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 ImmutableWebhookCreate build()
Builds a newImmutableWebhookCreate
.- Returns:
- An immutable instance of WebhookCreate
- Throws:
IllegalStateException
- if any required attributes are missing
-
-