Package org.projectnessie.model
Class ImmutableBranch
- java.lang.Object
-
- org.projectnessie.model.ImmutableBranch
-
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableBranch extends Object implements Branch
Immutable implementation ofBranch.Use the builder to create immutable instances:
ImmutableBranch.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableBranch.BuilderBuilds instances of typeImmutableBranch.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableBranch.Builderbuilder()Creates a builder forImmutableBranch.static ImmutableBranchcopyOf(Branch instance)Creates an immutable copy of aBranchvalue.booleanequals(Object another)This instance is equal to all instances ofImmutableBranchthat 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 valueBranchwith attribute values.ImmutableBranchwithHash(String value)Copy the current immutable object by setting a value for thehashattribute.ImmutableBranchwithName(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 ImmutableBranch 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 ImmutableBranch 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 ofImmutableBranchthat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:name,hash.
-
toString
public String toString()
Prints the immutable valueBranchwith attribute values.
-
copyOf
public static ImmutableBranch copyOf(Branch instance)
Creates an immutable copy of aBranchvalue. 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 Branch instance
-
builder
public static ImmutableBranch.Builder builder()
Creates a builder forImmutableBranch.ImmutableBranch.builder() .name(String) // requiredname.hash(String | null) // nullablehash.build();- Returns:
- A new ImmutableBranch builder
-
-