Record Class RepositorySnapshot

java.lang.Object
java.lang.Record
io.github.jbastgen.stemma.app.git.RepositorySnapshot

public record RepositorySnapshot(Path workTree, Optional<String> currentBranch, List<io.github.jbastgen.stemma.git.api.BranchInfo> branches, List<io.github.jbastgen.stemma.git.api.CommitInfo> commits, List<io.github.jbastgen.stemma.git.api.StatusEntry> status, List<io.github.jbastgen.stemma.git.api.TagInfo> tags, List<io.github.jbastgen.stemma.git.api.StashInfo> stashes, List<io.github.jbastgen.stemma.git.api.RemoteInfo> remotes, Optional<io.github.jbastgen.stemma.git.api.TrackingInfo> tracking, boolean mergeInProgress, boolean rebaseInProgress, String detachedHead, Optional<GitFlowConfig> flow, io.github.jbastgen.stemma.git.api.SequenceKind sequence) extends Record
Immutable view of everything the main window shows about one repository at one point in time.
  • Constructor Summary

    Constructors
    Constructor
    Description
    RepositorySnapshot(Path workTree, Optional<String> currentBranch, List<io.github.jbastgen.stemma.git.api.BranchInfo> branches, List<io.github.jbastgen.stemma.git.api.CommitInfo> commits, List<io.github.jbastgen.stemma.git.api.StatusEntry> status)
    A snapshot with only history, branches and status (everything else empty).
    RepositorySnapshot(Path workTree, Optional<String> currentBranch, List<io.github.jbastgen.stemma.git.api.BranchInfo> branches, List<io.github.jbastgen.stemma.git.api.CommitInfo> commits, List<io.github.jbastgen.stemma.git.api.StatusEntry> status, List<io.github.jbastgen.stemma.git.api.TagInfo> tags, List<io.github.jbastgen.stemma.git.api.StashInfo> stashes, List<io.github.jbastgen.stemma.git.api.RemoteInfo> remotes, Optional<io.github.jbastgen.stemma.git.api.TrackingInfo> tracking, boolean mergeInProgress, boolean rebaseInProgress, String detachedHead, Optional<GitFlowConfig> flow, io.github.jbastgen.stemma.git.api.SequenceKind sequence)
    Creates an instance of a RepositorySnapshot record class.
    RepositorySnapshot(Path workTree, Optional<String> currentBranch, List<io.github.jbastgen.stemma.git.api.BranchInfo> branches, List<io.github.jbastgen.stemma.git.api.CommitInfo> commits, List<io.github.jbastgen.stemma.git.api.StatusEntry> status, List<io.github.jbastgen.stemma.git.api.TagInfo> tags, List<io.github.jbastgen.stemma.git.api.StashInfo> stashes, List<io.github.jbastgen.stemma.git.api.RemoteInfo> remotes, Optional<io.github.jbastgen.stemma.git.api.TrackingInfo> tracking, boolean mergeInProgress, Optional<GitFlowConfig> flow)
    A snapshot of a repository that is not rebasing and whose HEAD is on a branch.
  • Method Summary

    Modifier and Type
    Method
    Description
    List<io.github.jbastgen.stemma.git.api.BranchInfo>
    Returns the value of the branches record component.
    List<io.github.jbastgen.stemma.git.api.CommitInfo>
    Returns the value of the commits record component.
    Returns the value of the currentBranch record component.
    Returns the value of the detachedHead record component.
    The name of the work tree folder, for lists and titles.
    final boolean
    Indicates whether some other object is "equal to" this one.
    Returns the value of the flow record component.
    final int
    Returns a hash code value for this object.
    boolean
    Returns the value of the mergeInProgress record component.
    boolean
    Returns the value of the rebaseInProgress record component.
    List<io.github.jbastgen.stemma.git.api.RemoteInfo>
    Returns the value of the remotes record component.
    io.github.jbastgen.stemma.git.api.SequenceKind
    Returns the value of the sequence record component.
    List<io.github.jbastgen.stemma.git.api.StashInfo>
    Returns the value of the stashes record component.
    List<io.github.jbastgen.stemma.git.api.StatusEntry>
    Returns the value of the status record component.
    List<io.github.jbastgen.stemma.git.api.TagInfo>
    Returns the value of the tags record component.
    final String
    Returns a string representation of this record class.
    Optional<io.github.jbastgen.stemma.git.api.TrackingInfo>
    Returns the value of the tracking record component.
    Returns the value of the workTree record component.

    Methods inherited from class java.lang.Object

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

    • RepositorySnapshot

      public RepositorySnapshot(Path workTree, Optional<String> currentBranch, List<io.github.jbastgen.stemma.git.api.BranchInfo> branches, List<io.github.jbastgen.stemma.git.api.CommitInfo> commits, List<io.github.jbastgen.stemma.git.api.StatusEntry> status, List<io.github.jbastgen.stemma.git.api.TagInfo> tags, List<io.github.jbastgen.stemma.git.api.StashInfo> stashes, List<io.github.jbastgen.stemma.git.api.RemoteInfo> remotes, Optional<io.github.jbastgen.stemma.git.api.TrackingInfo> tracking, boolean mergeInProgress, Optional<GitFlowConfig> flow)
      A snapshot of a repository that is not rebasing and whose HEAD is on a branch.
    • RepositorySnapshot

      public RepositorySnapshot(Path workTree, Optional<String> currentBranch, List<io.github.jbastgen.stemma.git.api.BranchInfo> branches, List<io.github.jbastgen.stemma.git.api.CommitInfo> commits, List<io.github.jbastgen.stemma.git.api.StatusEntry> status)
      A snapshot with only history, branches and status (everything else empty).
    • RepositorySnapshot

      public RepositorySnapshot(Path workTree, Optional<String> currentBranch, List<io.github.jbastgen.stemma.git.api.BranchInfo> branches, List<io.github.jbastgen.stemma.git.api.CommitInfo> commits, List<io.github.jbastgen.stemma.git.api.StatusEntry> status, List<io.github.jbastgen.stemma.git.api.TagInfo> tags, List<io.github.jbastgen.stemma.git.api.StashInfo> stashes, List<io.github.jbastgen.stemma.git.api.RemoteInfo> remotes, Optional<io.github.jbastgen.stemma.git.api.TrackingInfo> tracking, boolean mergeInProgress, boolean rebaseInProgress, String detachedHead, Optional<GitFlowConfig> flow, io.github.jbastgen.stemma.git.api.SequenceKind sequence)
      Creates an instance of a RepositorySnapshot record class.
      Parameters:
      workTree - the value for the workTree record component
      currentBranch - the value for the currentBranch record component
      branches - the value for the branches record component
      commits - the value for the commits record component
      status - the value for the status record component
      tags - the value for the tags record component
      stashes - the value for the stashes record component
      remotes - the value for the remotes record component
      tracking - the value for the tracking record component
      mergeInProgress - the value for the mergeInProgress record component
      rebaseInProgress - the value for the rebaseInProgress record component
      detachedHead - the value for the detachedHead record component
      flow - the value for the flow record component
      sequence - the value for the sequence record component
  • Method Details

    • displayName

      public String displayName()
      The name of the work tree folder, for lists and titles.
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • workTree

      public Path workTree()
      Returns the value of the workTree record component.
      Returns:
      the value of the workTree record component
    • currentBranch

      public Optional<String> currentBranch()
      Returns the value of the currentBranch record component.
      Returns:
      the value of the currentBranch record component
    • branches

      public List<io.github.jbastgen.stemma.git.api.BranchInfo> branches()
      Returns the value of the branches record component.
      Returns:
      the value of the branches record component
    • commits

      public List<io.github.jbastgen.stemma.git.api.CommitInfo> commits()
      Returns the value of the commits record component.
      Returns:
      the value of the commits record component
    • status

      public List<io.github.jbastgen.stemma.git.api.StatusEntry> status()
      Returns the value of the status record component.
      Returns:
      the value of the status record component
    • tags

      public List<io.github.jbastgen.stemma.git.api.TagInfo> tags()
      Returns the value of the tags record component.
      Returns:
      the value of the tags record component
    • stashes

      public List<io.github.jbastgen.stemma.git.api.StashInfo> stashes()
      Returns the value of the stashes record component.
      Returns:
      the value of the stashes record component
    • remotes

      public List<io.github.jbastgen.stemma.git.api.RemoteInfo> remotes()
      Returns the value of the remotes record component.
      Returns:
      the value of the remotes record component
    • tracking

      public Optional<io.github.jbastgen.stemma.git.api.TrackingInfo> tracking()
      Returns the value of the tracking record component.
      Returns:
      the value of the tracking record component
    • mergeInProgress

      public boolean mergeInProgress()
      Returns the value of the mergeInProgress record component.
      Returns:
      the value of the mergeInProgress record component
    • rebaseInProgress

      public boolean rebaseInProgress()
      Returns the value of the rebaseInProgress record component.
      Returns:
      the value of the rebaseInProgress record component
    • detachedHead

      public String detachedHead()
      Returns the value of the detachedHead record component.
      Returns:
      the value of the detachedHead record component
    • flow

      public Optional<GitFlowConfig> flow()
      Returns the value of the flow record component.
      Returns:
      the value of the flow record component
    • sequence

      public io.github.jbastgen.stemma.git.api.SequenceKind sequence()
      Returns the value of the sequence record component.
      Returns:
      the value of the sequence record component