Record Class CommitInfo

java.lang.Object
java.lang.Record
io.github.jbastgen.stemma.git.api.CommitInfo

public record CommitInfo(String id, String summary, String authorName, String authorEmail, Instant authorTime, List<String> parentIds) extends Record
A commit as shown in the history.
  • Constructor Summary

    Constructors
    Constructor
    Description
    CommitInfo(String id, String summary, String authorName, String authorEmail, Instant authorTime, List<String> parentIds)
    Creates an instance of a CommitInfo record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the value of the authorEmail record component.
    Returns the value of the authorName record component.
    Returns the value of the authorTime record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    id()
    Returns the value of the id record component.
    boolean
    Whether the commit joins branches, i.e. has more than one parent.
    Returns the value of the parentIds record component.
    Abbreviated commit id (first 7 characters).
    Returns the value of the summary record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • CommitInfo

      public CommitInfo(String id, String summary, String authorName, String authorEmail, Instant authorTime, List<String> parentIds)
      Creates an instance of a CommitInfo record class.
      Parameters:
      id - the value for the id record component
      summary - the value for the summary record component
      authorName - the value for the authorName record component
      authorEmail - the value for the authorEmail record component
      authorTime - the value for the authorTime record component
      parentIds - the value for the parentIds record component
  • Method Details

    • shortId

      public String shortId()
      Abbreviated commit id (first 7 characters).
    • isMerge

      public boolean isMerge()
      Whether the commit joins branches, i.e. has more than one parent.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • id

      public String id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • summary

      public String summary()
      Returns the value of the summary record component.
      Returns:
      the value of the summary record component
    • authorName

      public String authorName()
      Returns the value of the authorName record component.
      Returns:
      the value of the authorName record component
    • authorEmail

      public String authorEmail()
      Returns the value of the authorEmail record component.
      Returns:
      the value of the authorEmail record component
    • authorTime

      public Instant authorTime()
      Returns the value of the authorTime record component.
      Returns:
      the value of the authorTime record component
    • parentIds

      public List<String> parentIds()
      Returns the value of the parentIds record component.
      Returns:
      the value of the parentIds record component