Record Class GitSource.Change

java.lang.Object
java.lang.Record
network.ike.docs.plugin.diff.GitSource.Change
Record Components:
status - the change status
oldPath - the from-side path (equal to newPath except for renames; null for additions)
newPath - the to-side path (null for deletions)
Enclosing class:
GitSource

public static record GitSource.Change(ChangeStatus status, String oldPath, String newPath) extends Record
One changed file between the two sides.
  • Constructor Details

    • Change

      public Change(ChangeStatus status, String oldPath, String newPath)
      Creates an instance of a Change record class.
      Parameters:
      status - the value for the status record component
      oldPath - the value for the oldPath record component
      newPath - the value for the newPath record component
  • Method Details

    • displayPath

      public String displayPath()
      The path a reader should know this file by — the to side when present, otherwise the from side.
      Returns:
      the display path
    • 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.
    • status

      public ChangeStatus status()
      Returns the value of the status record component.
      Returns:
      the value of the status record component
    • oldPath

      public String oldPath()
      Returns the value of the oldPath record component.
      Returns:
      the value of the oldPath record component
    • newPath

      public String newPath()
      Returns the value of the newPath record component.
      Returns:
      the value of the newPath record component