Package org.projectnessie.model
Class ImmutableReferenceMetadata
- java.lang.Object
-
- org.projectnessie.model.ImmutableReferenceMetadata
-
- All Implemented Interfaces:
ReferenceMetadata
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableReferenceMetadata extends Object implements ReferenceMetadata
Immutable implementation ofReferenceMetadata.Use the builder to create immutable instances:
ImmutableReferenceMetadata.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableReferenceMetadata.BuilderBuilds instances of typeImmutableReferenceMetadata.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableReferenceMetadata.Builderbuilder()Creates a builder forImmutableReferenceMetadata.static ImmutableReferenceMetadatacopyOf(ReferenceMetadata instance)Creates an immutable copy of aReferenceMetadatavalue.booleanequals(Object another)This instance is equal to all instances ofImmutableReferenceMetadatathat have equal attribute values.CommitMetagetCommitMetaOfHEAD()StringgetCommonAncestorHash()IntegergetNumCommitsAhead()IntegergetNumCommitsBehind()LonggetNumTotalCommits()inthashCode()Computes a hash code from attributes:numCommitsAhead,numCommitsBehind,commitMetaOfHEAD,commonAncestorHash,numTotalCommits.StringtoString()Prints the immutable valueReferenceMetadatawith attribute values.ImmutableReferenceMetadatawithCommitMetaOfHEAD(CommitMeta value)Copy the current immutable object by setting a value for thecommitMetaOfHEADattribute.ImmutableReferenceMetadatawithCommonAncestorHash(String value)Copy the current immutable object by setting a value for thecommonAncestorHashattribute.ImmutableReferenceMetadatawithNumCommitsAhead(Integer value)Copy the current immutable object by setting a value for thenumCommitsAheadattribute.ImmutableReferenceMetadatawithNumCommitsBehind(Integer value)Copy the current immutable object by setting a value for thenumCommitsBehindattribute.ImmutableReferenceMetadatawithNumTotalCommits(Long value)Copy the current immutable object by setting a value for thenumTotalCommitsattribute.
-
-
-
Method Detail
-
getNumCommitsAhead
@Nullable public Integer getNumCommitsAhead()
- Specified by:
getNumCommitsAheadin interfaceReferenceMetadata- Returns:
- The value of the
numCommitsAheadattribute
-
getNumCommitsBehind
@Nullable public Integer getNumCommitsBehind()
- Specified by:
getNumCommitsBehindin interfaceReferenceMetadata- Returns:
- The value of the
numCommitsBehindattribute
-
getCommitMetaOfHEAD
@Nullable public CommitMeta getCommitMetaOfHEAD()
- Specified by:
getCommitMetaOfHEADin interfaceReferenceMetadata- Returns:
- The value of the
commitMetaOfHEADattribute
-
getCommonAncestorHash
@Nullable public String getCommonAncestorHash()
- Specified by:
getCommonAncestorHashin interfaceReferenceMetadata- Returns:
- The value of the
commonAncestorHashattribute
-
getNumTotalCommits
@Nullable public Long getNumTotalCommits()
- Specified by:
getNumTotalCommitsin interfaceReferenceMetadata- Returns:
- The value of the
numTotalCommitsattribute
-
withNumCommitsAhead
public final ImmutableReferenceMetadata withNumCommitsAhead(@Nullable Integer value)
Copy the current immutable object by setting a value for thenumCommitsAheadattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for numCommitsAhead (can benull)- Returns:
- A modified copy of the
thisobject
-
withNumCommitsBehind
public final ImmutableReferenceMetadata withNumCommitsBehind(@Nullable Integer value)
Copy the current immutable object by setting a value for thenumCommitsBehindattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for numCommitsBehind (can benull)- Returns:
- A modified copy of the
thisobject
-
withCommitMetaOfHEAD
public final ImmutableReferenceMetadata withCommitMetaOfHEAD(@Nullable CommitMeta value)
Copy the current immutable object by setting a value for thecommitMetaOfHEADattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for commitMetaOfHEAD (can benull)- Returns:
- A modified copy of the
thisobject
-
withCommonAncestorHash
public final ImmutableReferenceMetadata withCommonAncestorHash(@Nullable String value)
Copy the current immutable object by setting a value for thecommonAncestorHashattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for commonAncestorHash (can benull)- Returns:
- A modified copy of the
thisobject
-
withNumTotalCommits
public final ImmutableReferenceMetadata withNumTotalCommits(@Nullable Long value)
Copy the current immutable object by setting a value for thenumTotalCommitsattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for numTotalCommits (can benull)- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutableReferenceMetadatathat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:numCommitsAhead,numCommitsBehind,commitMetaOfHEAD,commonAncestorHash,numTotalCommits.
-
toString
public String toString()
Prints the immutable valueReferenceMetadatawith attribute values.
-
copyOf
public static ImmutableReferenceMetadata copyOf(ReferenceMetadata instance)
Creates an immutable copy of aReferenceMetadatavalue. 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 ReferenceMetadata instance
-
builder
public static ImmutableReferenceMetadata.Builder builder()
Creates a builder forImmutableReferenceMetadata.ImmutableReferenceMetadata.builder() .numCommitsAhead(Integer | null) // nullablenumCommitsAhead.numCommitsBehind(Integer | null) // nullablenumCommitsBehind.commitMetaOfHEAD(org.projectnessie.model.CommitMeta | null) // nullablecommitMetaOfHEAD.commonAncestorHash(String | null) // nullablecommonAncestorHash.numTotalCommits(Long | null) // nullablenumTotalCommits.build();- Returns:
- A new ImmutableReferenceMetadata builder
-
-