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 class
ImmutableCreateEvent.Builder
Builds instances of typeImmutableCreateEvent
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableCreateEvent.Builder
builder()
Creates a builder forImmutableCreateEvent
.static ImmutableCreateEvent
copyOf(CreateEvent instance)
Creates an immutable copy of aCreateEvent
value.Optional<String>
description()
The repository's current description.boolean
equals(Object another)
This instance is equal to all instances ofImmutableCreateEvent
that have equal attribute values.EventInstallation
eventInstallation()
TheEventInstallation
, if the event comes from a Github App.int
hashCode()
Computes a hash code from attributes:repository
,sender
,eventInstallation
,ref
,refType
,masterBranch
,description
,pusherType
.String
masterBranch()
The name of the repository's default branch (usually master).String
pusherType()
No doc found on github - Usually is "user".String
ref()
The git ref (or null if only a repository was created).String
refType()
The object that was created.Repository
repository()
TheRepository
User
sender()
TheUser
that triggered/sent the event.String
toString()
Prints the immutable valueCreateEvent
with attribute values.ImmutableCreateEvent
withDescription(Optional<String> value)
Copy the current immutable object by setting a value for thedescription
attribute.ImmutableCreateEvent
withEventInstallation(EventInstallation value)
Copy the current immutable object by setting a value for theeventInstallation
attribute.ImmutableCreateEvent
withMasterBranch(String value)
Copy the current immutable object by setting a value for themasterBranch
attribute.ImmutableCreateEvent
withPusherType(String value)
Copy the current immutable object by setting a value for thepusherType
attribute.ImmutableCreateEvent
withRef(String value)
Copy the current immutable object by setting a value for theref
attribute.ImmutableCreateEvent
withRefType(String value)
Copy the current immutable object by setting a value for therefType
attribute.ImmutableCreateEvent
withRepository(Repository value)
Copy the current immutable object by setting a value for therepository
attribute.ImmutableCreateEvent
withSender(User value)
Copy the current immutable object by setting a value for thesender
attribute.
-
-
-
Method Detail
-
repository
@Nullable public Repository repository()
TheRepository
- Specified by:
repository
in interfaceBaseEvent
-
eventInstallation
@Nullable public EventInstallation eventInstallation()
TheEventInstallation
, if the event comes from a Github App.- Specified by:
eventInstallation
in interfaceBaseEvent
-
ref
@Nullable public String ref()
The git ref (or null if only a repository was created).- Specified by:
ref
in interfaceCreateEvent
-
refType
@Nullable public String refType()
The object that was created. Can be one of "repository", "branch", or "tag"- Specified by:
refType
in interfaceCreateEvent
-
masterBranch
@Nullable public String masterBranch()
The name of the repository's default branch (usually master).- Specified by:
masterBranch
in interfaceCreateEvent
-
description
@Nullable public Optional<String> description()
The repository's current description.- Specified by:
description
in interfaceCreateEvent
-
pusherType
@Nullable public String pusherType()
No doc found on github - Usually is "user".- Specified by:
pusherType
in interfaceCreateEvent
-
withRepository
public final ImmutableCreateEvent withRepository(@Nullable Repository value)
Copy the current immutable object by setting a value for therepository
attribute. 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
this
object
-
withSender
public final ImmutableCreateEvent withSender(@Nullable User value)
Copy the current immutable object by setting a value for thesender
attribute. 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
this
object
-
withEventInstallation
public final ImmutableCreateEvent withEventInstallation(@Nullable EventInstallation value)
Copy the current immutable object by setting a value for theeventInstallation
attribute. 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
this
object
-
withRef
public final ImmutableCreateEvent withRef(@Nullable String value)
Copy the current immutable object by setting a value for theref
attribute. 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
this
object
-
withRefType
public final ImmutableCreateEvent withRefType(@Nullable String value)
Copy the current immutable object by setting a value for therefType
attribute. 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
this
object
-
withMasterBranch
public final ImmutableCreateEvent withMasterBranch(@Nullable String value)
Copy the current immutable object by setting a value for themasterBranch
attribute. 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
this
object
-
withDescription
public final ImmutableCreateEvent withDescription(@Nullable Optional<String> value)
Copy the current immutable object by setting a value for thedescription
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for description (can benull
)- Returns:
- A modified copy of the
this
object
-
withPusherType
public final ImmutableCreateEvent withPusherType(@Nullable String value)
Copy the current immutable object by setting a value for thepusherType
attribute. 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
this
object
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutableCreateEvent
that 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 valueCreateEvent
with attribute values.
-
copyOf
public static ImmutableCreateEvent copyOf(CreateEvent instance)
Creates an immutable copy of aCreateEvent
value. 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) // nullable
repository
.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(Optional<String> | null) // nullabledescription
.pusherType(String | null) // nullablepusherType
.build();- Returns:
- A new ImmutableCreateEvent builder
-
-