Package com.spotify.github.v3.git
Class ImmutableShaLink
- java.lang.Object
-
- com.spotify.github.v3.git.ImmutableShaLink
-
- All Implemented Interfaces:
ShaLink
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableShaLink extends Object implements ShaLink
Immutable implementation ofShaLink.Use the builder to create immutable instances:
ImmutableShaLink.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableShaLink.BuilderBuilds instances of typeImmutableShaLink.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableShaLink.Builderbuilder()Creates a builder forImmutableShaLink.static ImmutableShaLinkcopyOf(ShaLink instance)Creates an immutable copy of aShaLinkvalue.booleanequals(Object another)This instance is equal to all instances ofImmutableShaLinkthat have equal attribute values.inthashCode()Computes a hash code from attributes:sha,url.Stringsha()SHA.StringtoString()Prints the immutable valueShaLinkwith attribute values.URIurl()URL.ImmutableShaLinkwithSha(String value)Copy the current immutable object by setting a value for theshaattribute.ImmutableShaLinkwithUrl(URI value)Copy the current immutable object by setting a value for theurlattribute.
-
-
-
Method Detail
-
withSha
public final ImmutableShaLink 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
-
withUrl
public final ImmutableShaLink withUrl(@Nullable URI value)
Copy the current immutable object by setting a value for theurlattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for url (can benull)- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutableShaLinkthat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:sha,url.
-
toString
public String toString()
Prints the immutable valueShaLinkwith attribute values.
-
copyOf
public static ImmutableShaLink copyOf(ShaLink instance)
Creates an immutable copy of aShaLinkvalue. 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 ShaLink instance
-
builder
public static ImmutableShaLink.Builder builder()
Creates a builder forImmutableShaLink.ImmutableShaLink.builder() .sha(String | null) // nullablesha.url(java.net.URI | null) // nullableurl.build();- Returns:
- A new ImmutableShaLink builder
-
-