Package com.spotify.github.v3.git
Class ImmutableReferenceObject
- java.lang.Object
-
- com.spotify.github.v3.git.ImmutableReferenceObject
-
- All Implemented Interfaces:
ReferenceObject,ShaLink
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableReferenceObject extends Object implements ReferenceObject
Immutable implementation ofReferenceObject.Use the builder to create immutable instances:
ImmutableReferenceObject.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableReferenceObject.BuilderBuilds instances of typeImmutableReferenceObject.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableReferenceObject.Builderbuilder()Creates a builder forImmutableReferenceObject.static ImmutableReferenceObjectcopyOf(ReferenceObject instance)Creates an immutable copy of aReferenceObjectvalue.booleanequals(Object another)This instance is equal to all instances ofImmutableReferenceObjectthat have equal attribute values.inthashCode()Computes a hash code from attributes:sha,url,type.Stringsha()SHA.StringtoString()Prints the immutable valueReferenceObjectwith attribute values.Stringtype()The type of the reference object.URIurl()URL.ImmutableReferenceObjectwithSha(String value)Copy the current immutable object by setting a value for theshaattribute.ImmutableReferenceObjectwithType(String value)Copy the current immutable object by setting a value for thetypeattribute.ImmutableReferenceObjectwithUrl(URI value)Copy the current immutable object by setting a value for theurlattribute.
-
-
-
Method Detail
-
type
@Nullable public String type()
The type of the reference object.- Specified by:
typein interfaceReferenceObject
-
withSha
public final ImmutableReferenceObject 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 ImmutableReferenceObject 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
-
withType
public final ImmutableReferenceObject withType(@Nullable String value)
Copy the current immutable object by setting a value for thetypeattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for type (can benull)- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutableReferenceObjectthat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:sha,url,type.
-
toString
public String toString()
Prints the immutable valueReferenceObjectwith attribute values.
-
copyOf
public static ImmutableReferenceObject copyOf(ReferenceObject instance)
Creates an immutable copy of aReferenceObjectvalue. 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 ReferenceObject instance
-
builder
public static ImmutableReferenceObject.Builder builder()
Creates a builder forImmutableReferenceObject.ImmutableReferenceObject.builder() .sha(String | null) // nullablesha.url(java.net.URI | null) // nullableurl.type(String | null) // nullabletype.build();- Returns:
- A new ImmutableReferenceObject builder
-
-