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 classImmutableCommitStatus.BuilderBuilds instances of typeImmutableCommitStatus.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableCommitStatus.Builderbuilder()Creates a builder forImmutableCommitStatus.static ImmutableCommitStatuscopyOf(CommitStatus instance)Creates an immutable copy of aCommitStatusvalue.booleanequals(Object another)This instance is equal to all instances ofImmutableCommitStatusthat have equal attribute values.inthashCode()Computes a hash code from attributes:state,statuses,sha.Stringsha()The commit SHA.Stringstate()The result of the status.List<Status>statuses()Statuses list.StringtoString()Prints the immutable valueCommitStatuswith attribute values.ImmutableCommitStatuswithSha(String value)Copy the current immutable object by setting a value for theshaattribute.ImmutableCommitStatuswithState(String value)Copy the current immutable object by setting a value for thestateattribute.ImmutableCommitStatuswithStatuses(Status... elements)Copy the current immutable object with elements that replace the content ofstatuses.ImmutableCommitStatuswithStatuses(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:
statein interfaceCommitStatus- Returns:
- the string
-
statuses
@Nullable public List<Status> statuses()
Statuses list.- Specified by:
statusesin interfaceCommitStatus- Returns:
- the list
-
sha
@Nullable public String sha()
The commit SHA.- Specified by:
shain interfaceCommitStatus- Returns:
- the string
-
withState
public final ImmutableCommitStatus 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
-
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
thisobject
-
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
thisobject
-
withSha
public final ImmutableCommitStatus 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
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutableCommitStatusthat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:state,statuses,sha.
-
toString
public String toString()
Prints the immutable valueCommitStatuswith attribute values.
-
copyOf
public static ImmutableCommitStatus copyOf(CommitStatus instance)
Creates an immutable copy of aCommitStatusvalue. 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) // nullablestate.statuses(List<com.spotify.github.v3.repos.Status> | null) // nullablestatuses.sha(String | null) // nullablesha.build();- Returns:
- A new ImmutableCommitStatus builder
-
-