Class ImmutableBaseEvent.Builder
- java.lang.Object
-
- com.spotify.github.v3.activity.events.ImmutableBaseEvent.Builder
-
- Enclosing class:
- ImmutableBaseEvent
@NotThreadSafe public static final class ImmutableBaseEvent.Builder extends Object
Builds instances of typeImmutableBaseEvent. 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 ImmutableBaseEventbuild()Builds a newImmutableBaseEvent.ImmutableBaseEvent.BuildereventInstallation(EventInstallation eventInstallation)Initializes the value for theeventInstallationattribute.ImmutableBaseEvent.Builderfrom(BaseEvent instance)Fill a builder with attribute values from the providedBaseEventinstance.ImmutableBaseEvent.Builderrepository(Repository repository)Initializes the value for therepositoryattribute.ImmutableBaseEvent.Buildersender(User sender)Initializes the value for thesenderattribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableBaseEvent.Builder from(BaseEvent instance)
Fill a builder with attribute values from the providedBaseEventinstance. 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:
thisbuilder for use in a chained invocation
-
repository
@CanIgnoreReturnValue public final ImmutableBaseEvent.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 ImmutableBaseEvent.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 ImmutableBaseEvent.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
-
build
public ImmutableBaseEvent build()
Builds a newImmutableBaseEvent.- Returns:
- An immutable instance of BaseEvent
- Throws:
IllegalStateException- if any required attributes are missing
-
-