Package org.projectnessie.model
Class ImmutableDetached
- java.lang.Object
-
- org.projectnessie.model.ImmutableDetached
-
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableDetached extends Object implements Detached
Immutable implementation ofDetached.Use the builder to create immutable instances:
ImmutableDetached.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableDetached.BuilderBuilds instances of typeImmutableDetached.-
Nested classes/interfaces inherited from interface org.projectnessie.model.Reference
Reference.ReferenceType
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableDetached.Builderbuilder()Creates a builder forImmutableDetached.static ImmutableDetachedcopyOf(Detached instance)Creates an immutable copy of aDetachedvalue.booleanequals(Object another)This instance is equal to all instances ofImmutableDetachedthat have equal attribute values.StringgetHash()backend system id.ReferenceMetadatagetMetadata()Returns aReferenceMetadatainstance that contains additional metadata about this reference.inthashCode()Computes a hash code from attributes:metadata,hash.StringtoString()Prints the immutable valueDetachedwith attribute values.ImmutableDetachedwithHash(String value)Copy the current immutable object by setting a value for thehashattribute.ImmutableDetachedwithMetadata(ReferenceMetadata value)Copy the current immutable object by setting a value for themetadataattribute.
-
-
-
Method Detail
-
getMetadata
@Nullable public ReferenceMetadata getMetadata()
Returns aReferenceMetadatainstance that contains additional metadata about this reference. Note that this is only added by the server when explicitly requested by the client.- Specified by:
getMetadatain interfaceReference- Returns:
- A
ReferenceMetadatainstance that contains additional metadata about this reference. Note that this is only added by the server when explicitly requested by the client.
-
getHash
public String getHash()
Description copied from interface:Referencebackend system id. Usually the 32-byte hash of the commit this reference points to.
-
withMetadata
public final ImmutableDetached withMetadata(@Nullable ReferenceMetadata value)
Copy the current immutable object by setting a value for themetadataattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for metadata (can benull)- Returns:
- A modified copy of the
thisobject
-
withHash
public final ImmutableDetached withHash(String value)
Copy the current immutable object by setting a value for thehashattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for hash- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutableDetachedthat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:metadata,hash.
-
toString
public String toString()
Prints the immutable valueDetachedwith attribute values.
-
copyOf
public static ImmutableDetached copyOf(Detached instance)
Creates an immutable copy of aDetachedvalue. 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 Detached instance
-
builder
public static ImmutableDetached.Builder builder()
Creates a builder forImmutableDetached.ImmutableDetached.builder() .metadata(org.projectnessie.model.ReferenceMetadata | null) // nullablemetadata.hash(String) // requiredhash.build();- Returns:
- A new ImmutableDetached builder
-
-