Record Class ConflictVersions

java.lang.Object
java.lang.Record
io.github.jbastgen.stemma.git.api.ConflictVersions

public record ConflictVersions(String path, byte[] base, byte[] ours, byte[] theirs) extends Record
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

    Constructors
    Constructor
    Description
    ConflictVersions(String path, byte[] base, byte[] ours, byte[] theirs)
    Creates an instance of a ConflictVersions record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    byte[]
    Returns the value of the base record component.
    boolean
    Whether the file cannot be merged as text: one of its versions contains a NUL byte.
    boolean
    Deleted on one side and changed on the other.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    byte[]
    Returns the value of the ours record component.
    Returns the value of the path record component.
    byte[]
    Returns the value of the theirs record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

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

    • ConflictVersions

      public ConflictVersions(String path, byte[] base, byte[] ours, byte[] theirs)
      Creates an instance of a ConflictVersions record class.
      Parameters:
      path - the value for the path record component
      base - the value for the base record component
      ours - the value for the ours record component
      theirs - the value for the theirs record 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

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

      public String path()
      Returns the value of the path record component.
      Returns:
      the value of the path record component
    • base

      public byte[] base()
      Returns the value of the base record component.
      Returns:
      the value of the base record component
    • ours

      public byte[] ours()
      Returns the value of the ours record component.
      Returns:
      the value of the ours record component
    • theirs

      public byte[] theirs()
      Returns the value of the theirs record component.
      Returns:
      the value of the theirs record component