Class ImmutableCreateEvent
- java.lang.Object
-
- com.spotify.github.v3.activity.events.ImmutableCreateEvent
-
- All Implemented Interfaces:
BaseEvent,CreateEvent
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableCreateEvent extends Object implements CreateEvent
Immutable implementation ofCreateEvent.Use the builder to create immutable instances:
ImmutableCreateEvent.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableCreateEvent.BuilderBuilds instances of typeImmutableCreateEvent.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableCreateEvent.Builderbuilder()Creates a builder forImmutableCreateEvent.static ImmutableCreateEventcopyOf(CreateEvent instance)Creates an immutable copy of aCreateEventvalue.Optional<String>description()The repository's current description.booleanequals(Object another)This instance is equal to all instances ofImmutableCreateEventthat have equal attribute values.EventInstallationeventInstallation()TheEventInstallation, if the event comes from a Github App.inthashCode()Computes a hash code from attributes:repository,sender,eventInstallation,ref,refType,masterBranch,description,pusherType.StringmasterBranch()The name of the repository's default branch (usually master).StringpusherType()No doc found on github - Usually is "user".Stringref()The git ref (or null if only a repository was created).StringrefType()The object that was created.Repositoryrepository()TheRepositoryUsersender()TheUserthat triggered/sent the event.StringtoString()Prints the immutable valueCreateEventwith attribute values.ImmutableCreateEventwithDescription(String value)Copy the current immutable object by setting a present value for the optionaldescriptionattribute.ImmutableCreateEventwithDescription(Optional<String> optional)Copy the current immutable object by setting an optional value for thedescriptionattribute.ImmutableCreateEventwithEventInstallation(EventInstallation value)Copy the current immutable object by setting a value for theeventInstallationattribute.ImmutableCreateEventwithMasterBranch(String value)Copy the current immutable object by setting a value for themasterBranchattribute.ImmutableCreateEventwithPusherType(String value)Copy the current immutable object by setting a value for thepusherTypeattribute.ImmutableCreateEventwithRef(String value)Copy the current immutable object by setting a value for therefattribute.ImmutableCreateEventwithRefType(String value)Copy the current immutable object by setting a value for therefTypeattribute.ImmutableCreateEventwithRepository(Repository value)Copy the current immutable object by setting a value for therepositoryattribute.ImmutableCreateEventwithSender(User value)Copy the current immutable object by setting a value for thesenderattribute.
-
-
-
Method Detail
-
repository
@Nullable public Repository repository()
TheRepository- Specified by:
repositoryin interfaceBaseEvent
-
eventInstallation
@Nullable public EventInstallation eventInstallation()
TheEventInstallation, if the event comes from a Github App.- Specified by:
eventInstallationin interfaceBaseEvent
-
ref
@Nullable public String ref()
The git ref (or null if only a repository was created).- Specified by:
refin interfaceCreateEvent
-
refType
@Nullable public String refType()
The object that was created. Can be one of "repository", "branch", or "tag"- Specified by:
refTypein interfaceCreateEvent
-
masterBranch
@Nullable public String masterBranch()
The name of the repository's default branch (usually master).- Specified by:
masterBranchin interfaceCreateEvent
-
description
public Optional<String> description()
The repository's current description.- Specified by:
descriptionin interfaceCreateEvent
-
pusherType
@Nullable public String pusherType()
No doc found on github - Usually is "user".- Specified by:
pusherTypein interfaceCreateEvent
-
withRepository
public final ImmutableCreateEvent withRepository(@Nullable Repository value)
Copy the current immutable object by setting a value for therepositoryattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for repository (can benull)- Returns:
- A modified copy of the
thisobject
-
withSender
public final ImmutableCreateEvent withSender(@Nullable User value)
Copy the current immutable object by setting a value for thesenderattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for sender (can benull)- Returns:
- A modified copy of the
thisobject
-
withEventInstallation
public final ImmutableCreateEvent withEventInstallation(@Nullable EventInstallation value)
Copy the current immutable object by setting a value for theeventInstallationattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for eventInstallation (can benull)- Returns:
- A modified copy of the
thisobject
-
withRef
public final ImmutableCreateEvent withRef(@Nullable String value)
Copy the current immutable object by setting a value for therefattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for ref (can benull)- Returns:
- A modified copy of the
thisobject
-
withRefType
public final ImmutableCreateEvent withRefType(@Nullable String value)
Copy the current immutable object by setting a value for therefTypeattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for refType (can benull)- Returns:
- A modified copy of the
thisobject
-
withMasterBranch
public final ImmutableCreateEvent withMasterBranch(@Nullable String value)
Copy the current immutable object by setting a value for themasterBranchattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for masterBranch (can benull)- Returns:
- A modified copy of the
thisobject
-
withDescription
public final ImmutableCreateEvent withDescription(String value)
Copy the current immutable object by setting a present value for the optionaldescriptionattribute.- Parameters:
value- The value for description- Returns:
- A modified copy of
thisobject
-
withDescription
public final ImmutableCreateEvent withDescription(Optional<String> optional)
Copy the current immutable object by setting an optional value for thedescriptionattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for description- Returns:
- A modified copy of
thisobject
-
withPusherType
public final ImmutableCreateEvent withPusherType(@Nullable String value)
Copy the current immutable object by setting a value for thepusherTypeattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for pusherType (can benull)- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutableCreateEventthat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:repository,sender,eventInstallation,ref,refType,masterBranch,description,pusherType.
-
toString
public String toString()
Prints the immutable valueCreateEventwith attribute values.
-
copyOf
public static ImmutableCreateEvent copyOf(CreateEvent instance)
Creates an immutable copy of aCreateEventvalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable CreateEvent instance
-
builder
public static ImmutableCreateEvent.Builder builder()
Creates a builder forImmutableCreateEvent.ImmutableCreateEvent.builder() .repository(com.spotify.github.v3.repos.Repository | null) // nullablerepository.sender(com.spotify.github.v3.User | null) // nullablesender.eventInstallation(com.spotify.github.v3.activity.events.EventInstallation | null) // nullableeventInstallation.ref(String | null) // nullableref.refType(String | null) // nullablerefType.masterBranch(String | null) // nullablemasterBranch.description(String) // optionaldescription.pusherType(String | null) // nullablepusherType.build();- Returns:
- A new ImmutableCreateEvent builder
-
-