Class SingleCharacterFilter

java.lang.Object
com.maybeitssquid.safeascii.SingleCharacterFilter
All Implemented Interfaces:
IntFunction<CharSequence>

public class SingleCharacterFilter extends Object implements IntFunction<CharSequence>
Filters out results that are not single characters.
  • Constructor Details

    • SingleCharacterFilter

      public SingleCharacterFilter(IntFunction<CharSequence> delegate)
      Creates a new SingleCharacterFilter with the specified delegate.
      Parameters:
      delegate - the function to apply before filtering
  • Method Details

    • apply

      public CharSequence apply(int value)
      Applies the delegate function and returns the result only if it is a single character.
      Specified by:
      apply in interface IntFunction<CharSequence>
      Parameters:
      value - the Unicode codepoint to process
      Returns:
      the delegate's result if it is exactly one character, otherwise an empty string