Package com.spotify.github.v3.prs
Class ImmutablePullRequestRef
- java.lang.Object
-
- com.spotify.github.v3.prs.ImmutablePullRequestRef
-
- All Implemented Interfaces:
PullRequestRef
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutablePullRequestRef extends Object implements PullRequestRef
Immutable implementation ofPullRequestRef
.Use the builder to create immutable instances:
ImmutablePullRequestRef.builder()
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ImmutablePullRequestRef.Builder
Builds instances of typeImmutablePullRequestRef
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutablePullRequestRef.Builder
builder()
Creates a builder forImmutablePullRequestRef
.static ImmutablePullRequestRef
copyOf(PullRequestRef instance)
Creates an immutable copy of aPullRequestRef
value.boolean
equals(Object another)
This instance is equal to all instances ofImmutablePullRequestRef
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:label
,ref
,sha
,user
,repo
.Optional<String>
label()
LabelString
ref()
ReferenceOptional<Repository>
repo()
RepositoryString
sha()
SHAString
toString()
Prints the immutable valuePullRequestRef
with attribute values.Optional<User>
user()
UserImmutablePullRequestRef
withLabel(String value)
Copy the current immutable object by setting a present value for the optionallabel
attribute.ImmutablePullRequestRef
withLabel(Optional<String> optional)
Copy the current immutable object by setting an optional value for thelabel
attribute.ImmutablePullRequestRef
withRef(String value)
Copy the current immutable object by setting a value for theref
attribute.ImmutablePullRequestRef
withRepo(Repository value)
Copy the current immutable object by setting a present value for the optionalrepo
attribute.ImmutablePullRequestRef
withRepo(Optional<? extends Repository> optional)
Copy the current immutable object by setting an optional value for therepo
attribute.ImmutablePullRequestRef
withSha(String value)
Copy the current immutable object by setting a value for thesha
attribute.ImmutablePullRequestRef
withUser(User value)
Copy the current immutable object by setting a present value for the optionaluser
attribute.ImmutablePullRequestRef
withUser(Optional<? extends User> optional)
Copy the current immutable object by setting an optional value for theuser
attribute.
-
-
-
Method Detail
-
label
public Optional<String> label()
Label- Specified by:
label
in interfacePullRequestRef
-
ref
@Nullable public String ref()
Reference- Specified by:
ref
in interfacePullRequestRef
-
sha
@Nullable public String sha()
SHA- Specified by:
sha
in interfacePullRequestRef
-
user
public Optional<User> user()
User- Specified by:
user
in interfacePullRequestRef
-
repo
public Optional<Repository> repo()
Repository- Specified by:
repo
in interfacePullRequestRef
-
withLabel
public final ImmutablePullRequestRef withLabel(String value)
Copy the current immutable object by setting a present value for the optionallabel
attribute.- Parameters:
value
- The value for label- Returns:
- A modified copy of
this
object
-
withLabel
public final ImmutablePullRequestRef withLabel(Optional<String> optional)
Copy the current immutable object by setting an optional value for thelabel
attribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis
.- Parameters:
optional
- A value for label- Returns:
- A modified copy of
this
object
-
withRef
public final ImmutablePullRequestRef 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
-
withSha
public final ImmutablePullRequestRef 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
-
withUser
public final ImmutablePullRequestRef withUser(User value)
Copy the current immutable object by setting a present value for the optionaluser
attribute.- Parameters:
value
- The value for user- Returns:
- A modified copy of
this
object
-
withUser
public final ImmutablePullRequestRef withUser(Optional<? extends User> optional)
Copy the current immutable object by setting an optional value for theuser
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 user- Returns:
- A modified copy of
this
object
-
withRepo
public final ImmutablePullRequestRef withRepo(Repository value)
Copy the current immutable object by setting a present value for the optionalrepo
attribute.- Parameters:
value
- The value for repo- Returns:
- A modified copy of
this
object
-
withRepo
public final ImmutablePullRequestRef withRepo(Optional<? extends Repository> optional)
Copy the current immutable object by setting an optional value for therepo
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 repo- Returns:
- A modified copy of
this
object
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutablePullRequestRef
that have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:label
,ref
,sha
,user
,repo
.
-
toString
public String toString()
Prints the immutable valuePullRequestRef
with attribute values.
-
copyOf
public static ImmutablePullRequestRef copyOf(PullRequestRef instance)
Creates an immutable copy of aPullRequestRef
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 PullRequestRef instance
-
builder
public static ImmutablePullRequestRef.Builder builder()
Creates a builder forImmutablePullRequestRef
.ImmutablePullRequestRef.builder() .label(String) // optional
label
.ref(String | null) // nullableref
.sha(String | null) // nullablesha
.user(com.spotify.github.v3.User) // optionaluser
.repo(com.spotify.github.v3.repos.Repository) // optionalrepo
.build();- Returns:
- A new ImmutablePullRequestRef builder
-
-