Class ImmutableForkEvent
- java.lang.Object
-
- com.spotify.github.v3.activity.events.ImmutableForkEvent
-
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableForkEvent extends Object implements ForkEvent
Immutable implementation ofForkEvent.Use the builder to create immutable instances:
ImmutableForkEvent.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableForkEvent.BuilderBuilds instances of typeImmutableForkEvent.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableForkEvent.Builderbuilder()Creates a builder forImmutableForkEvent.static ImmutableForkEventcopyOf(ForkEvent instance)Creates an immutable copy of aForkEventvalue.booleanequals(Object another)This instance is equal to all instances ofImmutableForkEventthat have equal attribute values.EventInstallationeventInstallation()TheEventInstallation, if the event comes from a Github App.Repositoryforkee()TheRepositorythat was created.inthashCode()Computes a hash code from attributes:repository,sender,eventInstallation,forkee.Repositoryrepository()TheRepositoryUsersender()TheUserthat triggered/sent the event.StringtoString()Prints the immutable valueForkEventwith attribute values.ImmutableForkEventwithEventInstallation(EventInstallation value)Copy the current immutable object by setting a value for theeventInstallationattribute.ImmutableForkEventwithForkee(Repository value)Copy the current immutable object by setting a value for theforkeeattribute.ImmutableForkEventwithRepository(Repository value)Copy the current immutable object by setting a value for therepositoryattribute.ImmutableForkEventwithSender(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
-
forkee
@Nullable public Repository forkee()
TheRepositorythat was created.
-
withRepository
public final ImmutableForkEvent 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 ImmutableForkEvent 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 ImmutableForkEvent 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
-
withForkee
public final ImmutableForkEvent withForkee(@Nullable Repository value)
Copy the current immutable object by setting a value for theforkeeattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for forkee (can benull)- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutableForkEventthat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:repository,sender,eventInstallation,forkee.
-
toString
public String toString()
Prints the immutable valueForkEventwith attribute values.
-
copyOf
public static ImmutableForkEvent copyOf(ForkEvent instance)
Creates an immutable copy of aForkEventvalue. 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 ForkEvent instance
-
builder
public static ImmutableForkEvent.Builder builder()
Creates a builder forImmutableForkEvent.ImmutableForkEvent.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.forkee(com.spotify.github.v3.repos.Repository | null) // nullableforkee.build();- Returns:
- A new ImmutableForkEvent builder
-
-