java.lang.Object
java.lang.Record
com.inductiveautomation.ignition.common.i18n.translation.TermKey
All Implemented Interfaces:
Serializable

public record TermKey(String original, int computedHash) extends Record implements Serializable
This class lets us map source strings to hash table results using different types of rules. For example, we may choose to ignore case or not. This works by having the source, plus a hash code computed based on our desired set of rules.
See Also:
  • Constructor Details

    • TermKey

      public TermKey()
      For serialization
    • TermKey

      public TermKey(String originalTerm, String adapted)
    • TermKey

      public TermKey(String original, int computedHash)
      Creates an instance of a TermKey record class.
      Parameters:
      original - the value for the original record component
      computedHash - the value for the computedHash record component
  • Method Details

    • getSourceTerm

      public String getSourceTerm()
    • hashCode

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

      public String original()
      Returns the value of the original record component.
      Returns:
      the value of the original record component
    • computedHash

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