Record Class PatchString

java.lang.Object
java.lang.Record
org.variantsync.diffdetective.variation.diff.source.PatchString
Record Components:
getDiff - The patch as a String.
All Implemented Interfaces:
TextBasedDiff, Source

public record PatchString(String getDiff) extends Record implements TextBasedDiff, Source
Source for VariationDiffs that were created from a patch given as a String.
  • Field Details

    • getDiff

      private final String getDiff
      The field for the getDiff record component.
  • Constructor Details

    • PatchString

      public PatchString(String getDiff)
      Creates an instance of a PatchString record class.
      Parameters:
      getDiff - the value for the getDiff record component
  • Method Details

    • getSourceExplanation

      public String getSourceExplanation()
      Description copied from interface: Source
      Returns a short, one line explanation or identifier of this source. The result is used by Source.shallowExplanation() and is formatted together with Source.getSourceArguments() like "sourceExplanation(argument1, argument2)".
      Specified by:
      getSourceExplanation in interface Source
    • toString

      public 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.
    • getDiff

      public String getDiff()
      Returns the value of the getDiff record component.
      Specified by:
      getDiff in interface TextBasedDiff
      Returns:
      the value of the getDiff record component