Record Class RegexMove

java.lang.Object
java.lang.Record
net.minecraft.util.filefix.operations.RegexMove
All Implemented Interfaces:
FileFixOperation

public record RegexMove(Pattern fromPattern, String toReplacement) extends Record implements FileFixOperation
  • Field Details

    • fromPattern

      private final Pattern fromPattern
      The field for the fromPattern record component.
    • toReplacement

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

    • RegexMove

      public RegexMove(String fromPattern, String toPattern)
    • RegexMove

      public RegexMove(Pattern fromPattern, String toReplacement)
      Creates an instance of a RegexMove record class.
      Parameters:
      fromPattern - the value for the fromPattern record component
      toReplacement - the value for the toReplacement record component
  • Method Details

    • fix

      public void fix(Path baseDirectory, UpgradeProgress upgradeProgress) throws IOException
      Specified by:
      fix in interface FileFixOperation
      Throws:
      IOException
    • 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.
    • fromPattern

      public Pattern fromPattern()
      Returns the value of the fromPattern record component.
      Returns:
      the value of the fromPattern record component
    • toReplacement

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