Class ImmutableCommitMeta

    • 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:
        getHash in class CommitMeta
      • 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:
        getCommitter in class CommitMeta
      • 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:
        getSignedOffBy in class CommitMeta
      • 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:
        getMessage in class CommitMeta
      • 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:
        getProperties in class CommitMeta
      • withHash

        public final ImmutableCommitMeta withHash​(@Nullable
                                                  String value)
        Copy the current immutable object by setting a value for the hash attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for hash (can be null)
        Returns:
        A modified copy of the this object
      • withCommitter

        public final ImmutableCommitMeta withCommitter​(@Nullable
                                                       String value)
        Copy the current immutable object by setting a value for the committer attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for committer (can be null)
        Returns:
        A modified copy of the this object
      • withAuthor

        public final ImmutableCommitMeta withAuthor​(@Nullable
                                                    String value)
        Copy the current immutable object by setting a value for the author attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for author (can be null)
        Returns:
        A modified copy of the this object
      • withSignedOffBy

        public final ImmutableCommitMeta withSignedOffBy​(@Nullable
                                                         String value)
        Copy the current immutable object by setting a value for the signedOffBy attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for signedOffBy (can be null)
        Returns:
        A modified copy of the this object
      • withMessage

        public final ImmutableCommitMeta withMessage​(String value)
        Copy the current immutable object by setting a value for the message attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for message
        Returns:
        A modified copy of the this object
      • withCommitTime

        public final ImmutableCommitMeta withCommitTime​(@Nullable
                                                        Instant value)
        Copy the current immutable object by setting a value for the commitTime attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for commitTime (can be null)
        Returns:
        A modified copy of the this object
      • withAuthorTime

        public final ImmutableCommitMeta withAuthorTime​(@Nullable
                                                        Instant value)
        Copy the current immutable object by setting a value for the authorTime attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for authorTime (can be null)
        Returns:
        A modified copy of the this object
      • withProperties

        public final ImmutableCommitMeta withProperties​(Map<String,​? extends String> entries)
        Copy the current immutable object by replacing the properties map 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 returning this.
        Parameters:
        entries - The entries to be added to the properties map
        Returns:
        A modified copy of this object
      • equals

        public boolean equals​(@Nullable
                              Object another)
        This instance is equal to all instances of ImmutableCommitMeta that have equal attribute values.
        Overrides:
        equals in class Object
        Returns:
        true if this is equal to another instance
      • hashCode

        public int hashCode()
        Returns a precomputed-on-construction hash code from attributes: hash, committer, author, signedOffBy, message, commitTime, authorTime, properties.
        Overrides:
        hashCode in class Object
        Returns:
        hashCode value
      • toString

        public String toString()
        Prints the immutable value CommitMeta with attribute values.
        Overrides:
        toString in class Object
        Returns:
        A string representation of the value
      • copyOf

        public static ImmutableCommitMeta copyOf​(CommitMeta instance)
        Creates an immutable copy of a CommitMeta value. 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 for ImmutableCommitMeta.
         ImmutableCommitMeta.builder()
            .hash(String | null) // nullable hash
            .committer(String | null) // nullable committer
            .author(String | null) // nullable author
            .signedOffBy(String | null) // nullable signedOffBy
            .message(String) // required message
            .commitTime(java.time.Instant | null) // nullable commitTime
            .authorTime(java.time.Instant | null) // nullable authorTime
            .putProperties|putAllProperties(String => String) // properties mappings
            .build();
         
        Returns:
        A new ImmutableCommitMeta builder