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 classImmutableStatusEvent.BuilderBuilds 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.Builderbuilder()Creates a builder forImmutableStatusEvent.CommitItemcommit()Related git commitStringcontext()A string label to differentiate this status from the status of other systems.static ImmutableStatusEventcopyOf(StatusEvent instance)Creates an immutable copy of aStatusEventvalue.GitHubInstantcreatedAt()Created dateOptional<String>description()The optional human-readable description added to the status.booleanequals(Object another)This instance is equal to all instances ofImmutableStatusEventthat have equal attribute values.EventInstallationeventInstallation()TheEventInstallation, if the event comes from a Github App.inthashCode()Computes a hash code from attributes:repository,sender,eventInstallation,createdAt,updatedAt,id,sha,name,targetUrl,context,description,state,commit,branches.Longid()Status event idStringname()Full repository name.Repositoryrepository()TheRepositoryUsersender()TheUserthat triggered/sent the event.Stringsha()The Commit SHA.Stringstate()The new state.Optional<URI>targetUrl()The optional link added to the status.StringtoString()Prints the immutable valueStatusEventwith attribute values.GitHubInstantupdatedAt()Updated dateImmutableStatusEventwithBranches(Branch... elements)Copy the current immutable object with elements that replace the content ofbranches.ImmutableStatusEventwithBranches(Iterable<? extends Branch> elements)Copy the current immutable object with elements that replace the content ofbranches.ImmutableStatusEventwithCommit(CommitItem value)Copy the current immutable object by setting a value for thecommitattribute.ImmutableStatusEventwithContext(String value)Copy the current immutable object by setting a value for thecontextattribute.ImmutableStatusEventwithCreatedAt(GitHubInstant value)Copy the current immutable object by setting a value for thecreatedAtattribute.ImmutableStatusEventwithDescription(String value)Copy the current immutable object by setting a present value for the optionaldescriptionattribute.ImmutableStatusEventwithDescription(Optional<String> optional)Copy the current immutable object by setting an optional value for thedescriptionattribute.ImmutableStatusEventwithEventInstallation(EventInstallation value)Copy the current immutable object by setting a value for theeventInstallationattribute.ImmutableStatusEventwithId(Long value)Copy the current immutable object by setting a value for theidattribute.ImmutableStatusEventwithName(String value)Copy the current immutable object by setting a value for thenameattribute.ImmutableStatusEventwithRepository(Repository value)Copy the current immutable object by setting a value for therepositoryattribute.ImmutableStatusEventwithSender(User value)Copy the current immutable object by setting a value for thesenderattribute.ImmutableStatusEventwithSha(String value)Copy the current immutable object by setting a value for theshaattribute.ImmutableStatusEventwithState(String value)Copy the current immutable object by setting a value for thestateattribute.ImmutableStatusEventwithTargetUrl(URI value)Copy the current immutable object by setting a present value for the optionaltargetUrlattribute.ImmutableStatusEventwithTargetUrl(Optional<? extends URI> optional)Copy the current immutable object by setting an optional value for thetargetUrlattribute.ImmutableStatusEventwithUpdatedAt(GitHubInstant value)Copy the current immutable object by setting a value for theupdatedAtattribute.
-
-
-
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
-
createdAt
@Nullable public GitHubInstant createdAt()
Created date- Specified by:
createdAtin interfaceUpdateTracking- Returns:
- The date when the issue was created
-
updatedAt
@Nullable public GitHubInstant updatedAt()
Updated date- Specified by:
updatedAtin interfaceUpdateTracking- Returns:
- The date when the issue was updated
-
id
@Nullable public Long id()
Status event id- Specified by:
idin interfaceStatusEvent
-
sha
@Nullable public String sha()
The Commit SHA.- Specified by:
shain interfaceStatusEvent
-
name
@Nullable public String name()
Full repository name. E.g. organization/repo-name- Specified by:
namein interfaceStatusEvent
-
targetUrl
public Optional<URI> targetUrl()
The optional link added to the status.- Specified by:
targetUrlin 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:
contextin interfaceStatusEvent
-
description
public Optional<String> description()
The optional human-readable description added to the status.- Specified by:
descriptionin interfaceStatusEvent
-
state
@Nullable public String state()
The new state. Can be pending, success, failure, or error.- Specified by:
statein interfaceStatusEvent
-
commit
@Nullable public CommitItem commit()
Related git commit- Specified by:
commitin 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:
branchesin interfaceStatusEvent
-
withRepository
public final ImmutableStatusEvent 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 ImmutableStatusEvent 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 ImmutableStatusEvent 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
-
withCreatedAt
public final ImmutableStatusEvent withCreatedAt(@Nullable GitHubInstant value)
Copy the current immutable object by setting a value for thecreatedAtattribute. 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
thisobject
-
withUpdatedAt
public final ImmutableStatusEvent withUpdatedAt(@Nullable GitHubInstant value)
Copy the current immutable object by setting a value for theupdatedAtattribute. 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
thisobject
-
withId
public final ImmutableStatusEvent withId(@Nullable Long value)
Copy the current immutable object by setting a value for theidattribute. 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
thisobject
-
withSha
public final ImmutableStatusEvent withSha(@Nullable String value)
Copy the current immutable object by setting a value for theshaattribute. 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
thisobject
-
withName
public final ImmutableStatusEvent withName(@Nullable String value)
Copy the current immutable object by setting a value for thenameattribute. 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
thisobject
-
withTargetUrl
public final ImmutableStatusEvent withTargetUrl(URI value)
Copy the current immutable object by setting a present value for the optionaltargetUrlattribute.- Parameters:
value- The value for targetUrl- Returns:
- A modified copy of
thisobject
-
withTargetUrl
public final ImmutableStatusEvent withTargetUrl(Optional<? extends URI> optional)
Copy the current immutable object by setting an optional value for thetargetUrlattribute. 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
thisobject
-
withContext
public final ImmutableStatusEvent withContext(@Nullable String value)
Copy the current immutable object by setting a value for thecontextattribute. 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
thisobject
-
withDescription
public final ImmutableStatusEvent 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 ImmutableStatusEvent 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
-
withState
public final ImmutableStatusEvent withState(@Nullable String value)
Copy the current immutable object by setting a value for thestateattribute. 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
thisobject
-
withCommit
public final ImmutableStatusEvent withCommit(@Nullable CommitItem value)
Copy the current immutable object by setting a value for thecommitattribute. 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
thisobject
-
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
thisobject
-
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
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutableStatusEventthat 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 valueStatusEventwith attribute values.
-
copyOf
public static ImmutableStatusEvent copyOf(StatusEvent instance)
Creates an immutable copy of aStatusEventvalue. 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) // nullablerepository.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(String) // optionaldescription.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
-
-