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 class
ImmutableReferenceObject.Builder
Builds instances of typeImmutableReferenceObject
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableReferenceObject.Builder
builder()
Creates a builder forImmutableReferenceObject
.static ImmutableReferenceObject
copyOf(ReferenceObject instance)
Creates an immutable copy of aReferenceObject
value.boolean
equals(Object another)
This instance is equal to all instances ofImmutableReferenceObject
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:sha
,url
,type
.String
sha()
SHA.String
toString()
Prints the immutable valueReferenceObject
with attribute values.String
type()
The type of the reference object.URI
url()
URL.ImmutableReferenceObject
withSha(String value)
Copy the current immutable object by setting a value for thesha
attribute.ImmutableReferenceObject
withType(String value)
Copy the current immutable object by setting a value for thetype
attribute.ImmutableReferenceObject
withUrl(URI value)
Copy the current immutable object by setting a value for theurl
attribute.
-
-
-
Method Detail
-
type
@Nullable public String type()
The type of the reference object.- Specified by:
type
in interfaceReferenceObject
-
withSha
public final ImmutableReferenceObject 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
-
withUrl
public final ImmutableReferenceObject withUrl(@Nullable URI value)
Copy the current immutable object by setting a value for theurl
attribute. 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
this
object
-
withType
public final ImmutableReferenceObject withType(@Nullable String value)
Copy the current immutable object by setting a value for thetype
attribute. 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
this
object
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutableReferenceObject
that have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:sha
,url
,type
.
-
toString
public String toString()
Prints the immutable valueReferenceObject
with attribute values.
-
copyOf
public static ImmutableReferenceObject copyOf(ReferenceObject instance)
Creates an immutable copy of aReferenceObject
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 ReferenceObject instance
-
builder
public static ImmutableReferenceObject.Builder builder()
Creates a builder forImmutableReferenceObject
.ImmutableReferenceObject.builder() .sha(String | null) // nullable
sha
.url(java.net.URI | null) // nullableurl
.type(String | null) // nullabletype
.build();- Returns:
- A new ImmutableReferenceObject builder
-
-