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.StringgetName()Human readable reference name.inthashCode()Computes a hash code from attributes:name,hash.StringtoString()Prints the immutable valueTagwith attribute values.ImmutableTagwithHash(String value)Copy the current immutable object by setting a value for thehashattribute.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.
-
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
-
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.
-
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.build();- Returns:
- A new ImmutableTag builder
-
-