Record Class StashDetails

java.lang.Object
java.lang.Record
io.github.jbastgen.stemma.git.api.StashDetails
Record Components:
commitId - the stash commit: ask GitRepository.diff(io.github.jbastgen.stemma.git.api.DiffTarget, java.lang.String) for DiffTarget.OfCommit of it to see a tracked file
untrackedCommitId - the commit of the untracked files (every file in it is new), empty when none were stashed
files - the tracked files that changed (staged and unstaged together)
untrackedFiles - the untracked files that were stashed

public record StashDetails(String commitId, String untrackedCommitId, List<ChangedFile> files, List<ChangedFile> untrackedFiles) extends Record
What a stash holds, to show it like a commit. A stash is a commit on top of the commit it was made on; its changes against that commit are the tracked files. Untracked files, when they were stashed, are in a commit of their own (a third parent).
  • Constructor Details

    • StashDetails

      public StashDetails(String commitId, String untrackedCommitId, List<ChangedFile> files, List<ChangedFile> untrackedFiles)
      Creates an instance of a StashDetails record class.
      Parameters:
      commitId - the value for the commitId record component
      untrackedCommitId - the value for the untrackedCommitId record component
      files - the value for the files record component
      untrackedFiles - the value for the untrackedFiles 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.
    • commitId

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

      public String untrackedCommitId()
      Returns the value of the untrackedCommitId record component.
      Returns:
      the value of the untrackedCommitId record component
    • files

      public List<ChangedFile> files()
      Returns the value of the files record component.
      Returns:
      the value of the files record component
    • untrackedFiles

      public List<ChangedFile> untrackedFiles()
      Returns the value of the untrackedFiles record component.
      Returns:
      the value of the untrackedFiles record component