Package org.projectnessie.model
Class ImmutableTag
- java.lang.Object
-
- org.projectnessie.model.ImmutableTag
-
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableTag extends Object implements Tag
Immutable implementation ofTag.Use the builder to create immutable instances:
ImmutableTag.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableTag.BuilderBuilds instances of typeImmutableTag.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableTag.Builderbuilder()Creates a builder forImmutableTag.static ImmutableTagcopyOf(Tag instance)Creates an immutable copy of aTagvalue.booleanequals(Object another)This instance is equal to all instances ofImmutableTagthat have equal attribute values.StringgetHash()backend system id.ReferenceMetadatagetMetadata()Returns aReferenceMetadatainstance that contains additional metadata about this reference.StringgetName()Human-readable reference name.inthashCode()Computes a hash code from attributes:name,hash,metadata.StringtoString()Prints the immutable valueTagwith attribute values.ImmutableTagwithHash(String value)Copy the current immutable object by setting a value for thehashattribute.ImmutableTagwithMetadata(ReferenceMetadata value)Copy the current immutable object by setting a value for themetadataattribute.ImmutableTagwithName(String value)Copy the current immutable object by setting a value for thenameattribute.
-
-
-
Method Detail
-
getName
public String getName()
Human-readable reference name.
-
getHash
@Nullable public String getHash()
backend system id. Usually the 32-byte hash of the commit this reference points to.
-
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.
-
withName
public final ImmutableTag withName(String value)
Copy the current immutable object by setting a value for thenameattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for name- Returns:
- A modified copy of the
thisobject
-
withHash
public final ImmutableTag withHash(@Nullable 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 (can benull)- Returns:
- A modified copy of the
thisobject
-
withMetadata
public final ImmutableTag 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
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutableTagthat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:name,hash,metadata.
-
toString
public String toString()
Prints the immutable valueTagwith attribute values.
-
copyOf
public static ImmutableTag copyOf(Tag instance)
Creates an immutable copy of aTagvalue. 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 Tag instance
-
builder
public static ImmutableTag.Builder builder()
Creates a builder forImmutableTag.ImmutableTag.builder() .name(String) // requiredname.hash(String | null) // nullablehash.metadata(org.projectnessie.model.ReferenceMetadata | null) // nullablemetadata.build();- Returns:
- A new ImmutableTag builder
-
-