Class ImmutableCommitMeta
- java.lang.Object
-
- org.projectnessie.model.CommitMeta
-
- org.projectnessie.model.ImmutableCommitMeta
-
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableCommitMeta extends CommitMeta
Immutable implementation ofCommitMeta.Use the builder to create immutable instances:
ImmutableCommitMeta.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableCommitMeta.BuilderBuilds instances of typeImmutableCommitMeta.-
Nested classes/interfaces inherited from class org.projectnessie.model.CommitMeta
CommitMeta.InstantDeserializer, CommitMeta.InstantSerializer
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableCommitMeta.Builderbuilder()Creates a builder forImmutableCommitMeta.static ImmutableCommitMetacopyOf(CommitMeta instance)Creates an immutable copy of aCommitMetavalue.booleanequals(Object another)This instance is equal to all instances ofImmutableCommitMetathat have equal attribute values.StringgetAuthor()The author of a commit.InstantgetAuthorTime()Original commit time in UTC.StringgetCommitter()The entity performing this commit/transaction.InstantgetCommitTime()Commit time in UTC.StringgetHash()Hash of this commit.StringgetMessage()Message describing this commit.Map<String,String>getProperties()Set of properties to help further identify this commit.StringgetSignedOffBy()Authorizer of this action.inthashCode()Computes a hash code from attributes:hash,committer,author,signedOffBy,message,commitTime,authorTime,properties.StringtoString()Prints the immutable valueCommitMetawith attribute values.ImmutableCommitMetawithAuthor(String value)Copy the current immutable object by setting a value for theauthorattribute.ImmutableCommitMetawithAuthorTime(Instant value)Copy the current immutable object by setting a value for theauthorTimeattribute.ImmutableCommitMetawithCommitter(String value)Copy the current immutable object by setting a value for thecommitterattribute.ImmutableCommitMetawithCommitTime(Instant value)Copy the current immutable object by setting a value for thecommitTimeattribute.ImmutableCommitMetawithHash(String value)Copy the current immutable object by setting a value for thehashattribute.ImmutableCommitMetawithMessage(String value)Copy the current immutable object by setting a value for themessageattribute.ImmutableCommitMetawithProperties(Map<String,? extends String> entries)Copy the current immutable object by replacing thepropertiesmap with the specified map.ImmutableCommitMetawithSignedOffBy(String value)Copy the current immutable object by setting a value for thesignedOffByattribute.-
Methods inherited from class org.projectnessie.model.CommitMeta
fromMessage, toBuilder
-
-
-
-
Method Detail
-
getHash
@Nullable public String getHash()
Hash of this commit.This is not known at creation time and is only valid when reading the log.
- Specified by:
getHashin classCommitMeta
-
getCommitter
@Nullable public String getCommitter()
The entity performing this commit/transaction.This is the logged in user/account who performs this action. Populated on the server. Nessie will return an error if this is populated by the client side.
The committer should follow the git spec for names eg Committer Name <committer.name@example.com> but this is not enforced. See https://git-scm.com/docs/git-commit#Documentation/git-commit.txt---authorltauthorgt
- Specified by:
getCommitterin classCommitMeta
-
getAuthor
@Nullable public String getAuthor()
The author of a commit. This is the original committer.- Specified by:
getAuthorin classCommitMeta
-
getSignedOffBy
@Nullable public String getSignedOffBy()
Authorizer of this action.For example if the user who did the transaction is a service account this could be populated by the person who started the job.
- Specified by:
getSignedOffByin classCommitMeta
-
getMessage
public String getMessage()
Message describing this commit. Should conform to Git style.Like github if this message is in markdown it may be displayed cleanly in the UI.
- Specified by:
getMessagein classCommitMeta
-
getCommitTime
@Nullable public Instant getCommitTime()
Commit time in UTC. Set by the server.- Specified by:
getCommitTimein classCommitMeta
-
getAuthorTime
@Nullable public Instant getAuthorTime()
Original commit time in UTC. Set by the server.- Specified by:
getAuthorTimein classCommitMeta
-
getProperties
public Map<String,String> getProperties()
Set of properties to help further identify this commit.examples are spark id, the client type (eg iceberg, delta etc), application or job names, hostnames etc
- Specified by:
getPropertiesin classCommitMeta
-
withHash
public final ImmutableCommitMeta 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
-
withCommitter
public final ImmutableCommitMeta withCommitter(@Nullable String value)
Copy the current immutable object by setting a value for thecommitterattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for committer (can benull)- Returns:
- A modified copy of the
thisobject
-
withAuthor
public final ImmutableCommitMeta withAuthor(@Nullable String value)
Copy the current immutable object by setting a value for theauthorattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for author (can benull)- Returns:
- A modified copy of the
thisobject
-
withSignedOffBy
public final ImmutableCommitMeta withSignedOffBy(@Nullable String value)
Copy the current immutable object by setting a value for thesignedOffByattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for signedOffBy (can benull)- Returns:
- A modified copy of the
thisobject
-
withMessage
public final ImmutableCommitMeta withMessage(String value)
Copy the current immutable object by setting a value for themessageattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for message- Returns:
- A modified copy of the
thisobject
-
withCommitTime
public final ImmutableCommitMeta withCommitTime(@Nullable Instant value)
Copy the current immutable object by setting a value for thecommitTimeattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for commitTime (can benull)- Returns:
- A modified copy of the
thisobject
-
withAuthorTime
public final ImmutableCommitMeta withAuthorTime(@Nullable Instant value)
Copy the current immutable object by setting a value for theauthorTimeattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for authorTime (can benull)- Returns:
- A modified copy of the
thisobject
-
withProperties
public final ImmutableCommitMeta withProperties(Map<String,? extends String> entries)
Copy the current immutable object by replacing thepropertiesmap with the specified map. Nulls are not permitted as keys or values. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
entries- The entries to be added to the properties map- Returns:
- A modified copy of
thisobject
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutableCommitMetathat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:hash,committer,author,signedOffBy,message,commitTime,authorTime,properties.
-
toString
public String toString()
Prints the immutable valueCommitMetawith attribute values.
-
copyOf
public static ImmutableCommitMeta copyOf(CommitMeta instance)
Creates an immutable copy of aCommitMetavalue. 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 CommitMeta instance
-
builder
public static ImmutableCommitMeta.Builder builder()
Creates a builder forImmutableCommitMeta.ImmutableCommitMeta.builder() .hash(String | null) // nullablehash.committer(String | null) // nullablecommitter.author(String | null) // nullableauthor.signedOffBy(String | null) // nullablesignedOffBy.message(String) // requiredmessage.commitTime(java.time.Instant | null) // nullablecommitTime.authorTime(java.time.Instant | null) // nullableauthorTime.putProperties|putAllProperties(String => String) //propertiesmappings .build();- Returns:
- A new ImmutableCommitMeta builder
-
-