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
ConstructorsConstructorDescriptionRepositorySnapshot(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 aRepositorySnapshotrecord 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 TypeMethodDescriptionList<io.github.jbastgen.stemma.git.api.BranchInfo> branches()Returns the value of thebranchesrecord component.List<io.github.jbastgen.stemma.git.api.CommitInfo> commits()Returns the value of thecommitsrecord component.Returns the value of thecurrentBranchrecord component.Returns the value of thedetachedHeadrecord component.The name of the work tree folder, for lists and titles.final booleanIndicates whether some other object is "equal to" this one.flow()Returns the value of theflowrecord component.final inthashCode()Returns a hash code value for this object.booleanReturns the value of themergeInProgressrecord component.booleanReturns the value of therebaseInProgressrecord component.List<io.github.jbastgen.stemma.git.api.RemoteInfo> remotes()Returns the value of theremotesrecord component.io.github.jbastgen.stemma.git.api.SequenceKindsequence()Returns the value of thesequencerecord component.List<io.github.jbastgen.stemma.git.api.StashInfo> stashes()Returns the value of thestashesrecord component.List<io.github.jbastgen.stemma.git.api.StatusEntry> status()Returns the value of thestatusrecord component.List<io.github.jbastgen.stemma.git.api.TagInfo> tags()Returns the value of thetagsrecord component.final StringtoString()Returns a string representation of this record class.Optional<io.github.jbastgen.stemma.git.api.TrackingInfo> tracking()Returns the value of thetrackingrecord component.workTree()Returns the value of theworkTreerecord component.
-
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 aRepositorySnapshotrecord class.- Parameters:
workTree- the value for theworkTreerecord componentcurrentBranch- the value for thecurrentBranchrecord componentbranches- the value for thebranchesrecord componentcommits- the value for thecommitsrecord componentstatus- the value for thestatusrecord componenttags- the value for thetagsrecord componentstashes- the value for thestashesrecord componentremotes- the value for theremotesrecord componenttracking- the value for thetrackingrecord componentmergeInProgress- the value for themergeInProgressrecord componentrebaseInProgress- the value for therebaseInProgressrecord componentdetachedHead- the value for thedetachedHeadrecord componentflow- the value for theflowrecord componentsequence- the value for thesequencerecord component
-
-
Method Details
-
displayName
The name of the work tree folder, for lists and titles. -
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
workTree
Returns the value of theworkTreerecord component.- Returns:
- the value of the
workTreerecord component
-
currentBranch
Returns the value of thecurrentBranchrecord component.- Returns:
- the value of the
currentBranchrecord component
-
branches
Returns the value of thebranchesrecord component.- Returns:
- the value of the
branchesrecord component
-
commits
Returns the value of thecommitsrecord component.- Returns:
- the value of the
commitsrecord component
-
status
Returns the value of thestatusrecord component.- Returns:
- the value of the
statusrecord component
-
tags
Returns the value of thetagsrecord component.- Returns:
- the value of the
tagsrecord component
-
stashes
Returns the value of thestashesrecord component.- Returns:
- the value of the
stashesrecord component
-
remotes
Returns the value of theremotesrecord component.- Returns:
- the value of the
remotesrecord component
-
tracking
Returns the value of thetrackingrecord component.- Returns:
- the value of the
trackingrecord component
-
mergeInProgress
public boolean mergeInProgress()Returns the value of themergeInProgressrecord component.- Returns:
- the value of the
mergeInProgressrecord component
-
rebaseInProgress
public boolean rebaseInProgress()Returns the value of therebaseInProgressrecord component.- Returns:
- the value of the
rebaseInProgressrecord component
-
detachedHead
Returns the value of thedetachedHeadrecord component.- Returns:
- the value of the
detachedHeadrecord component
-
flow
Returns the value of theflowrecord component.- Returns:
- the value of the
flowrecord component
-
sequence
public io.github.jbastgen.stemma.git.api.SequenceKind sequence()Returns the value of thesequencerecord component.- Returns:
- the value of the
sequencerecord component
-