Record Class TranscodingErrorHandler.ReplacementString

java.lang.Object
java.lang.Record
com.oracle.truffle.api.strings.TranscodingErrorHandler.ReplacementString
Record Components:
replacement - the string to use as replacement for the erroneous region in the source string.
byteLength - the byte length of the region to replace. If this value is negative, let the transcoder determine the region length instead.
Enclosing interface:
TranscodingErrorHandler

public static record TranscodingErrorHandler.ReplacementString(TruffleString replacement, int byteLength) extends Record
Since:
23.1
  • Constructor Details

    • ReplacementString

      public ReplacementString(TruffleString replacement, int byteLength)
      Creates an instance of a ReplacementString record class.
      Parameters:
      replacement - the value for the replacement record component
      byteLength - the value for the byteLength record component
  • Method Details

    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • replacement

      public TruffleString replacement()
      Returns the value of the replacement record component.
      Returns:
      the value of the replacement record component
    • byteLength

      public int byteLength()
      Returns the value of the byteLength record component.
      Returns:
      the value of the byteLength record component