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 classImmutablePullRequestRef.BuilderBuilds instances of typeImmutablePullRequestRef.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutablePullRequestRef.Builderbuilder()Creates a builder forImmutablePullRequestRef.static ImmutablePullRequestRefcopyOf(PullRequestRef instance)Creates an immutable copy of aPullRequestRefvalue.booleanequals(Object another)This instance is equal to all instances ofImmutablePullRequestRefthat have equal attribute values.inthashCode()Computes a hash code from attributes:label,ref,sha,user,repo.Optional<String>label()LabelStringref()ReferenceOptional<Repository>repo()RepositoryStringsha()SHAStringtoString()Prints the immutable valuePullRequestRefwith attribute values.Optional<User>user()UserImmutablePullRequestRefwithLabel(String value)Copy the current immutable object by setting a present value for the optionallabelattribute.ImmutablePullRequestRefwithLabel(Optional<String> optional)Copy the current immutable object by setting an optional value for thelabelattribute.ImmutablePullRequestRefwithRef(String value)Copy the current immutable object by setting a value for therefattribute.ImmutablePullRequestRefwithRepo(Repository value)Copy the current immutable object by setting a present value for the optionalrepoattribute.ImmutablePullRequestRefwithRepo(Optional<? extends Repository> optional)Copy the current immutable object by setting an optional value for therepoattribute.ImmutablePullRequestRefwithSha(String value)Copy the current immutable object by setting a value for theshaattribute.ImmutablePullRequestRefwithUser(User value)Copy the current immutable object by setting a present value for the optionaluserattribute.ImmutablePullRequestRefwithUser(Optional<? extends User> optional)Copy the current immutable object by setting an optional value for theuserattribute.
-
-
-
Method Detail
-
label
public Optional<String> label()
Label- Specified by:
labelin interfacePullRequestRef
-
ref
@Nullable public String ref()
Reference- Specified by:
refin interfacePullRequestRef
-
sha
@Nullable public String sha()
SHA- Specified by:
shain interfacePullRequestRef
-
user
public Optional<User> user()
User- Specified by:
userin interfacePullRequestRef
-
repo
public Optional<Repository> repo()
Repository- Specified by:
repoin interfacePullRequestRef
-
withLabel
public final ImmutablePullRequestRef withLabel(String value)
Copy the current immutable object by setting a present value for the optionallabelattribute.- Parameters:
value- The value for label- Returns:
- A modified copy of
thisobject
-
withLabel
public final ImmutablePullRequestRef withLabel(Optional<String> optional)
Copy the current immutable object by setting an optional value for thelabelattribute. 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
thisobject
-
withRef
public final ImmutablePullRequestRef withRef(@Nullable String value)
Copy the current immutable object by setting a value for therefattribute. 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
thisobject
-
withSha
public final ImmutablePullRequestRef 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
-
withUser
public final ImmutablePullRequestRef withUser(User value)
Copy the current immutable object by setting a present value for the optionaluserattribute.- Parameters:
value- The value for user- Returns:
- A modified copy of
thisobject
-
withUser
public final ImmutablePullRequestRef withUser(Optional<? extends User> optional)
Copy the current immutable object by setting an optional value for theuserattribute. 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
thisobject
-
withRepo
public final ImmutablePullRequestRef withRepo(Repository value)
Copy the current immutable object by setting a present value for the optionalrepoattribute.- Parameters:
value- The value for repo- Returns:
- A modified copy of
thisobject
-
withRepo
public final ImmutablePullRequestRef withRepo(Optional<? extends Repository> optional)
Copy the current immutable object by setting an optional value for therepoattribute. 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
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutablePullRequestRefthat 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 valuePullRequestRefwith attribute values.
-
copyOf
public static ImmutablePullRequestRef copyOf(PullRequestRef instance)
Creates an immutable copy of aPullRequestRefvalue. 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) // optionallabel.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
-
-