Package com.spotify.github.v3.repos
Class ImmutableCommitStatus
- java.lang.Object
-
- com.spotify.github.v3.repos.ImmutableCommitStatus
-
- All Implemented Interfaces:
CommitStatus
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableCommitStatus extends Object implements CommitStatus
Immutable implementation ofCommitStatus
.Use the builder to create immutable instances:
ImmutableCommitStatus.builder()
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ImmutableCommitStatus.Builder
Builds instances of typeImmutableCommitStatus
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableCommitStatus.Builder
builder()
Creates a builder forImmutableCommitStatus
.static ImmutableCommitStatus
copyOf(CommitStatus instance)
Creates an immutable copy of aCommitStatus
value.boolean
equals(Object another)
This instance is equal to all instances ofImmutableCommitStatus
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:state
,statuses
,sha
.String
sha()
The commit SHA.String
state()
The result of the status.List<Status>
statuses()
Statuses list.String
toString()
Prints the immutable valueCommitStatus
with attribute values.ImmutableCommitStatus
withSha(String value)
Copy the current immutable object by setting a value for thesha
attribute.ImmutableCommitStatus
withState(String value)
Copy the current immutable object by setting a value for thestate
attribute.ImmutableCommitStatus
withStatuses(Status... elements)
Copy the current immutable object with elements that replace the content ofstatuses
.ImmutableCommitStatus
withStatuses(Iterable<? extends Status> elements)
Copy the current immutable object with elements that replace the content ofstatuses
.
-
-
-
Method Detail
-
state
@Nullable public String state()
The result of the status. Can be success, failure or pending.- Specified by:
state
in interfaceCommitStatus
- Returns:
- the string
-
statuses
@Nullable public List<Status> statuses()
Statuses list.- Specified by:
statuses
in interfaceCommitStatus
- Returns:
- the list
-
sha
@Nullable public String sha()
The commit SHA.- Specified by:
sha
in interfaceCommitStatus
- Returns:
- the string
-
withState
public final ImmutableCommitStatus 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
-
withStatuses
public final ImmutableCommitStatus withStatuses(@Nullable Status... elements)
Copy the current immutable object with elements that replace the content ofstatuses
.- Parameters:
elements
- The elements to set- Returns:
- A modified copy of
this
object
-
withStatuses
public final ImmutableCommitStatus withStatuses(@Nullable Iterable<? extends Status> elements)
Copy the current immutable object with elements that replace the content ofstatuses
. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
elements
- An iterable of statuses elements to set- Returns:
- A modified copy of
this
object
-
withSha
public final ImmutableCommitStatus 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
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutableCommitStatus
that have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:state
,statuses
,sha
.
-
toString
public String toString()
Prints the immutable valueCommitStatus
with attribute values.
-
copyOf
public static ImmutableCommitStatus copyOf(CommitStatus instance)
Creates an immutable copy of aCommitStatus
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 CommitStatus instance
-
builder
public static ImmutableCommitStatus.Builder builder()
Creates a builder forImmutableCommitStatus
.ImmutableCommitStatus.builder() .state(String | null) // nullable
state
.statuses(List<com.spotify.github.v3.repos.Status> | null) // nullablestatuses
.sha(String | null) // nullablesha
.build();- Returns:
- A new ImmutableCommitStatus builder
-
-