Record Class BackupInfo

java.lang.Object
java.lang.Record
io.github.jbastgen.stemma.git.api.BackupInfo
Record Components:
ref - the full name, e.g. refs/stemma/reset/20260301-091500-123
commitId - the backup commit
headId - the commit that was checked out when the backup was made; empty if the repository had no commit
created - when it was made
message - what the backup says it was made for

public record BackupInfo(String ref, String commitId, String headId, Instant created, String message) extends Record
A backup written by GitRepository.createBackup(java.lang.String, java.lang.String): a commit under refs/stemma/<kind>/<time> whose tree is the whole working tree (changed and untracked files, without ignored ones) at that moment, and whose parent is the commit that was checked out then.
  • Constructor Details

    • BackupInfo

      public BackupInfo(String ref, String commitId, String headId, Instant created, String message)
      Creates an instance of a BackupInfo record class.
      Parameters:
      ref - the value for the ref record component
      commitId - the value for the commitId record component
      headId - the value for the headId record component
      created - the value for the created record component
      message - the value for the message record component
  • Method Details

    • 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.
    • ref

      public String ref()
      Returns the value of the ref record component.
      Returns:
      the value of the ref record component
    • commitId

      public String commitId()
      Returns the value of the commitId record component.
      Returns:
      the value of the commitId record component
    • headId

      public String headId()
      Returns the value of the headId record component.
      Returns:
      the value of the headId record component
    • created

      public Instant created()
      Returns the value of the created record component.
      Returns:
      the value of the created record component
    • message

      public String message()
      Returns the value of the message record component.
      Returns:
      the value of the message record component