Class ImmutableCreateEvent.Builder
- java.lang.Object
-
- com.spotify.github.v3.activity.events.ImmutableCreateEvent.Builder
-
- Enclosing class:
- ImmutableCreateEvent
@NotThreadSafe public static final class ImmutableCreateEvent.Builder extends Object
Builds instances of typeImmutableCreateEvent. 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 ImmutableCreateEventbuild()Builds a newImmutableCreateEvent.ImmutableCreateEvent.Builderdescription(String description)Initializes the optional valuedescriptionto description.ImmutableCreateEvent.Builderdescription(Optional<String> description)Initializes the optional valuedescriptionto description.ImmutableCreateEvent.BuildereventInstallation(EventInstallation eventInstallation)Initializes the value for theeventInstallationattribute.ImmutableCreateEvent.Builderfrom(BaseEvent instance)Fill a builder with attribute values from the providedcom.spotify.github.v3.activity.events.BaseEventinstance.ImmutableCreateEvent.Builderfrom(CreateEvent instance)Fill a builder with attribute values from the providedcom.spotify.github.v3.activity.events.CreateEventinstance.ImmutableCreateEvent.BuildermasterBranch(String masterBranch)Initializes the value for themasterBranchattribute.ImmutableCreateEvent.BuilderpusherType(String pusherType)Initializes the value for thepusherTypeattribute.ImmutableCreateEvent.Builderref(String ref)Initializes the value for therefattribute.ImmutableCreateEvent.BuilderrefType(String refType)Initializes the value for therefTypeattribute.ImmutableCreateEvent.Builderrepository(Repository repository)Initializes the value for therepositoryattribute.ImmutableCreateEvent.Buildersender(User sender)Initializes the value for thesenderattribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableCreateEvent.Builder from(CreateEvent instance)
Fill a builder with attribute values from the providedcom.spotify.github.v3.activity.events.CreateEventinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
from
@CanIgnoreReturnValue public final ImmutableCreateEvent.Builder from(BaseEvent instance)
Fill a builder with attribute values from the providedcom.spotify.github.v3.activity.events.BaseEventinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
repository
@CanIgnoreReturnValue public final ImmutableCreateEvent.Builder repository(@Nullable Repository repository)
Initializes the value for therepositoryattribute.- Parameters:
repository- The value for repository (can benull)- Returns:
thisbuilder for use in a chained invocation
-
sender
@CanIgnoreReturnValue public final ImmutableCreateEvent.Builder sender(@Nullable User sender)
Initializes the value for thesenderattribute.- Parameters:
sender- The value for sender (can benull)- Returns:
thisbuilder for use in a chained invocation
-
eventInstallation
@CanIgnoreReturnValue public final ImmutableCreateEvent.Builder eventInstallation(@Nullable EventInstallation eventInstallation)
Initializes the value for theeventInstallationattribute.- Parameters:
eventInstallation- The value for eventInstallation (can benull)- Returns:
thisbuilder for use in a chained invocation
-
ref
@CanIgnoreReturnValue public final ImmutableCreateEvent.Builder ref(@Nullable String ref)
Initializes the value for therefattribute.- Parameters:
ref- The value for ref (can benull)- Returns:
thisbuilder for use in a chained invocation
-
refType
@CanIgnoreReturnValue public final ImmutableCreateEvent.Builder refType(@Nullable String refType)
Initializes the value for therefTypeattribute.- Parameters:
refType- The value for refType (can benull)- Returns:
thisbuilder for use in a chained invocation
-
masterBranch
@CanIgnoreReturnValue public final ImmutableCreateEvent.Builder masterBranch(@Nullable String masterBranch)
Initializes the value for themasterBranchattribute.- Parameters:
masterBranch- The value for masterBranch (can benull)- Returns:
thisbuilder for use in a chained invocation
-
description
@CanIgnoreReturnValue public final ImmutableCreateEvent.Builder description(String description)
Initializes the optional valuedescriptionto description.- Parameters:
description- The value for description- Returns:
thisbuilder for chained invocation
-
description
@CanIgnoreReturnValue public final ImmutableCreateEvent.Builder description(Optional<String> description)
Initializes the optional valuedescriptionto description.- Parameters:
description- The value for description- Returns:
thisbuilder for use in a chained invocation
-
pusherType
@CanIgnoreReturnValue public final ImmutableCreateEvent.Builder pusherType(@Nullable String pusherType)
Initializes the value for thepusherTypeattribute.- Parameters:
pusherType- The value for pusherType (can benull)- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableCreateEvent build()
Builds a newImmutableCreateEvent.- Returns:
- An immutable instance of CreateEvent
- Throws:
IllegalStateException- if any required attributes are missing
-
-