Record Class OffensiveWordFilter.Configuration
java.lang.Object
java.lang.Record
dev.getelements.elements.sdk.util.OffensiveWordFilter.Configuration
- Record Components:
words- the wordstransform- the transformation function to apply to input before checking
- Enclosing class:
OffensiveWordFilter
public static record OffensiveWordFilter.Configuration(List<OffensiveWordFilter.Word> words, Function<CharSequence,CharSequence> transform)
extends Record
Configuration for the OffensiveWordFilter.
-
Constructor Summary
ConstructorsConstructorDescriptionConfiguration(List<OffensiveWordFilter.Word> words, Function<CharSequence, CharSequence> transform) Creates an instance of aConfigurationrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.Returns the value of thetransformrecord component.transform(CharSequence charSequence) Applies the transformation function to the given CharSequence.words()Returns the value of thewordsrecord component.
-
Constructor Details
-
Configuration
public Configuration(List<OffensiveWordFilter.Word> words, Function<CharSequence, CharSequence> transform) Creates an instance of aConfigurationrecord class.
-
-
Method Details
-
transform
Applies the transformation function to the given CharSequence.- Parameters:
charSequence- the CharSequence to transform- Returns:
- the transformed CharSequence
-
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. -
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. -
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 withObjects::equals(Object,Object). -
words
Returns the value of thewordsrecord component.- Returns:
- the value of the
wordsrecord component
-
transform
Returns the value of thetransformrecord component.- Returns:
- the value of the
transformrecord component
-