Record Class KeyHashRule
java.lang.Object
java.lang.Record
com.inductiveautomation.ignition.common.i18n.translation.KeyHashRule
- Record Components:
caseInsensitive- Whether to lowercase the key.ignoreWhitespace- Whether to remove whitespace.ignorePunctuation- Whether to remove punctuation.ignoreTags- Whether to remove HTML tags.
public record KeyHashRule(boolean caseInsensitive, boolean ignoreWhitespace, boolean ignorePunctuation, boolean ignoreTags)
extends Record
Defines the normalization rules for creating a search key from a source key.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final KeyHashRuleAKeyHashRulethat does not adjust the input key at all -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.Reserved for the Vision XML deserializer, which instantiates rules embedded in windows saved by earlier versions.KeyHashRule(boolean caseInsensitive, boolean ignoreWhitespace, boolean ignorePunctuation, boolean ignoreTags) Creates an instance of aKeyHashRulerecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of thecaseInsensitiverecord component.final booleanIndicates whether some other object is "equal to" this one.@Nullable StringGenerates a normalized hash key for the given key based on the rules.final inthashCode()Returns a hash code value for this object.booleanReturns the value of theignorePunctuationrecord component.booleanReturns the value of theignoreTagsrecord component.booleanReturns the value of theignoreWhitespacerecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
IDENTITY
AKeyHashRulethat does not adjust the input key at all
-
-
Constructor Details
-
KeyHashRule
-
KeyHashRule
public KeyHashRule(boolean caseInsensitive, boolean ignoreWhitespace, boolean ignorePunctuation, boolean ignoreTags) Creates an instance of aKeyHashRulerecord class.- Parameters:
caseInsensitive- the value for thecaseInsensitiverecord componentignoreWhitespace- the value for theignoreWhitespacerecord componentignorePunctuation- the value for theignorePunctuationrecord componentignoreTags- the value for theignoreTagsrecord component
-
-
Method Details
-
getKey
Generates a normalized hash key for the given key based on the rules.- Parameters:
key- The raw source key.- Returns:
- The normalized "hash key" used for lookups, based on the enabled rules (e.g., lowercased, tags removed).
-
toString
-
hashCode
-
equals
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 thecomparemethod from their corresponding wrapper classes. -
caseInsensitive
public boolean caseInsensitive()Returns the value of thecaseInsensitiverecord component.- Returns:
- the value of the
caseInsensitiverecord component
-
ignoreWhitespace
public boolean ignoreWhitespace()Returns the value of theignoreWhitespacerecord component.- Returns:
- the value of the
ignoreWhitespacerecord component
-
ignorePunctuation
public boolean ignorePunctuation()Returns the value of theignorePunctuationrecord component.- Returns:
- the value of the
ignorePunctuationrecord component
-
ignoreTags
public boolean ignoreTags()Returns the value of theignoreTagsrecord component.- Returns:
- the value of the
ignoreTagsrecord component
-