Class ImmutableStatusEvent
- java.lang.Object
-
- com.spotify.github.v3.activity.events.ImmutableStatusEvent
-
- All Implemented Interfaces:
UpdateTracking
,BaseEvent
,StatusEvent
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableStatusEvent extends Object implements StatusEvent
Immutable implementation ofStatusEvent
.Use the builder to create immutable instances:
ImmutableStatusEvent.builder()
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ImmutableStatusEvent.Builder
Builds instances of typeImmutableStatusEvent
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Branch>
branches()
An array of branch objects containing the status' SHA.static ImmutableStatusEvent.Builder
builder()
Creates a builder forImmutableStatusEvent
.CommitItem
commit()
Related git commitString
context()
A string label to differentiate this status from the status of other systems.static ImmutableStatusEvent
copyOf(StatusEvent instance)
Creates an immutable copy of aStatusEvent
value.GitHubInstant
createdAt()
Created dateOptional<String>
description()
The optional human-readable description added to the status.boolean
equals(Object another)
This instance is equal to all instances ofImmutableStatusEvent
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
,createdAt
,updatedAt
,id
,sha
,name
,targetUrl
,context
,description
,state
,commit
,branches
.Long
id()
Status event idString
name()
Full repository name.Repository
repository()
TheRepository
User
sender()
TheUser
that triggered/sent the event.String
sha()
The Commit SHA.String
state()
The new state.Optional<URI>
targetUrl()
The optional link added to the status.String
toString()
Prints the immutable valueStatusEvent
with attribute values.GitHubInstant
updatedAt()
Updated dateImmutableStatusEvent
withBranches(Branch... elements)
Copy the current immutable object with elements that replace the content ofbranches
.ImmutableStatusEvent
withBranches(Iterable<? extends Branch> elements)
Copy the current immutable object with elements that replace the content ofbranches
.ImmutableStatusEvent
withCommit(CommitItem value)
Copy the current immutable object by setting a value for thecommit
attribute.ImmutableStatusEvent
withContext(String value)
Copy the current immutable object by setting a value for thecontext
attribute.ImmutableStatusEvent
withCreatedAt(GitHubInstant value)
Copy the current immutable object by setting a value for thecreatedAt
attribute.ImmutableStatusEvent
withDescription(Optional<String> value)
Copy the current immutable object by setting a value for thedescription
attribute.ImmutableStatusEvent
withEventInstallation(EventInstallation value)
Copy the current immutable object by setting a value for theeventInstallation
attribute.ImmutableStatusEvent
withId(Long value)
Copy the current immutable object by setting a value for theid
attribute.ImmutableStatusEvent
withName(String value)
Copy the current immutable object by setting a value for thename
attribute.ImmutableStatusEvent
withRepository(Repository value)
Copy the current immutable object by setting a value for therepository
attribute.ImmutableStatusEvent
withSender(User value)
Copy the current immutable object by setting a value for thesender
attribute.ImmutableStatusEvent
withSha(String value)
Copy the current immutable object by setting a value for thesha
attribute.ImmutableStatusEvent
withState(String value)
Copy the current immutable object by setting a value for thestate
attribute.ImmutableStatusEvent
withTargetUrl(URI value)
Copy the current immutable object by setting a present value for the optionaltargetUrl
attribute.ImmutableStatusEvent
withTargetUrl(Optional<? extends URI> optional)
Copy the current immutable object by setting an optional value for thetargetUrl
attribute.ImmutableStatusEvent
withUpdatedAt(GitHubInstant value)
Copy the current immutable object by setting a value for theupdatedAt
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
-
createdAt
@Nullable public GitHubInstant createdAt()
Created date- Specified by:
createdAt
in interfaceUpdateTracking
- Returns:
- The date when the issue was created
-
updatedAt
@Nullable public GitHubInstant updatedAt()
Updated date- Specified by:
updatedAt
in interfaceUpdateTracking
- Returns:
- The date when the issue was updated
-
id
@Nullable public Long id()
Status event id- Specified by:
id
in interfaceStatusEvent
-
sha
@Nullable public String sha()
The Commit SHA.- Specified by:
sha
in interfaceStatusEvent
-
name
@Nullable public String name()
Full repository name. E.g. organization/repo-name- Specified by:
name
in interfaceStatusEvent
-
targetUrl
public Optional<URI> targetUrl()
The optional link added to the status.- Specified by:
targetUrl
in interfaceStatusEvent
-
context
@Nullable public String context()
A string label to differentiate this status from the status of other systems. Example: continuous-integration/jenkins Default: "default"- Specified by:
context
in interfaceStatusEvent
-
description
@Nullable public Optional<String> description()
The optional human-readable description added to the status.- Specified by:
description
in interfaceStatusEvent
-
state
@Nullable public String state()
The new state. Can be pending, success, failure, or error.- Specified by:
state
in interfaceStatusEvent
-
commit
@Nullable public CommitItem commit()
Related git commit- Specified by:
commit
in interfaceStatusEvent
-
branches
@Nullable public List<Branch> branches()
An array of branch objects containing the status' SHA. Each branch contains the given SHA, but the SHA may or may not be the head of the branch. The array includes a maximum of 10 branches.- Specified by:
branches
in interfaceStatusEvent
-
withRepository
public final ImmutableStatusEvent 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 ImmutableStatusEvent 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 ImmutableStatusEvent 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
-
withCreatedAt
public final ImmutableStatusEvent withCreatedAt(@Nullable GitHubInstant value)
Copy the current immutable object by setting a value for thecreatedAt
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for createdAt (can benull
)- Returns:
- A modified copy of the
this
object
-
withUpdatedAt
public final ImmutableStatusEvent withUpdatedAt(@Nullable GitHubInstant value)
Copy the current immutable object by setting a value for theupdatedAt
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for updatedAt (can benull
)- Returns:
- A modified copy of the
this
object
-
withId
public final ImmutableStatusEvent withId(@Nullable Long value)
Copy the current immutable object by setting a value for theid
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for id (can benull
)- Returns:
- A modified copy of the
this
object
-
withSha
public final ImmutableStatusEvent withSha(@Nullable String value)
Copy the current immutable object by setting a value for thesha
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for sha (can benull
)- Returns:
- A modified copy of the
this
object
-
withName
public final ImmutableStatusEvent withName(@Nullable String value)
Copy the current immutable object by setting a value for thename
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for name (can benull
)- Returns:
- A modified copy of the
this
object
-
withTargetUrl
public final ImmutableStatusEvent withTargetUrl(URI value)
Copy the current immutable object by setting a present value for the optionaltargetUrl
attribute.- Parameters:
value
- The value for targetUrl- Returns:
- A modified copy of
this
object
-
withTargetUrl
public final ImmutableStatusEvent withTargetUrl(Optional<? extends URI> optional)
Copy the current immutable object by setting an optional value for thetargetUrl
attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis
.- Parameters:
optional
- A value for targetUrl- Returns:
- A modified copy of
this
object
-
withContext
public final ImmutableStatusEvent withContext(@Nullable String value)
Copy the current immutable object by setting a value for thecontext
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for context (can benull
)- Returns:
- A modified copy of the
this
object
-
withDescription
public final ImmutableStatusEvent 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
-
withState
public final ImmutableStatusEvent withState(@Nullable String value)
Copy the current immutable object by setting a value for thestate
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for state (can benull
)- Returns:
- A modified copy of the
this
object
-
withCommit
public final ImmutableStatusEvent withCommit(@Nullable CommitItem value)
Copy the current immutable object by setting a value for thecommit
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for commit (can benull
)- Returns:
- A modified copy of the
this
object
-
withBranches
public final ImmutableStatusEvent withBranches(@Nullable Branch... elements)
Copy the current immutable object with elements that replace the content ofbranches
.- Parameters:
elements
- The elements to set- Returns:
- A modified copy of
this
object
-
withBranches
public final ImmutableStatusEvent withBranches(@Nullable Iterable<? extends Branch> elements)
Copy the current immutable object with elements that replace the content ofbranches
. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
elements
- An iterable of branches elements to set- Returns:
- A modified copy of
this
object
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutableStatusEvent
that have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:repository
,sender
,eventInstallation
,createdAt
,updatedAt
,id
,sha
,name
,targetUrl
,context
,description
,state
,commit
,branches
.
-
toString
public String toString()
Prints the immutable valueStatusEvent
with attribute values.
-
copyOf
public static ImmutableStatusEvent copyOf(StatusEvent instance)
Creates an immutable copy of aStatusEvent
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 StatusEvent instance
-
builder
public static ImmutableStatusEvent.Builder builder()
Creates a builder forImmutableStatusEvent
.ImmutableStatusEvent.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
.createdAt(com.spotify.github.GitHubInstant | null) // nullablecreatedAt
.updatedAt(com.spotify.github.GitHubInstant | null) // nullableupdatedAt
.id(Long | null) // nullableid
.sha(String | null) // nullablesha
.name(String | null) // nullablename
.targetUrl(java.net.URI) // optionaltargetUrl
.context(String | null) // nullablecontext
.description(Optional<String> | null) // nullabledescription
.state(String | null) // nullablestate
.commit(com.spotify.github.v3.repos.CommitItem | null) // nullablecommit
.branches(List<com.spotify.github.v3.repos.Branch> | null) // nullablebranches
.build();- Returns:
- A new ImmutableStatusEvent builder
-
-