Record Class ConflictVersions
java.lang.Object
java.lang.Record
io.github.jbastgen.stemma.git.api.ConflictVersions
The three versions of a file that has a merge conflict, as they are in the index: the common ancestor, "ours" (the
branch that is checked out) and "theirs" (the branch that is merged). A version that does not exist (the file was
added on one side only, or deleted on one side) is
null.-
Constructor Summary
ConstructorsConstructorDescriptionConflictVersions(String path, byte[] base, byte[] ours, byte[] theirs) Creates an instance of aConflictVersionsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]base()Returns the value of thebaserecord component.booleanbinary()Whether the file cannot be merged as text: one of its versions contains a NUL byte.booleanDeleted on one side and changed on the other.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.byte[]ours()Returns the value of theoursrecord component.path()Returns the value of thepathrecord component.byte[]theirs()Returns the value of thetheirsrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ConflictVersions
Creates an instance of aConflictVersionsrecord class.- Parameters:
path- the value for thepathrecord componentbase- the value for thebaserecord componentours- the value for theoursrecord componenttheirs- the value for thetheirsrecord component
-
-
Method Details
-
binary
public boolean binary()Whether the file cannot be merged as text: one of its versions contains a NUL byte. -
deletedOnOneSide
public boolean deletedOnOneSide()Deleted on one side and changed on the other. -
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. All components in this record class are compared withObjects::equals(Object,Object). -
path
Returns the value of thepathrecord component.- Returns:
- the value of the
pathrecord component
-
base
public byte[] base()Returns the value of thebaserecord component.- Returns:
- the value of the
baserecord component
-
ours
public byte[] ours()Returns the value of theoursrecord component.- Returns:
- the value of the
oursrecord component
-
theirs
public byte[] theirs()Returns the value of thetheirsrecord component.- Returns:
- the value of the
theirsrecord component
-