Interface AsciiConverterConfig


public interface AsciiConverterConfig
Interface for the configuration of AsciiConverter usage. Abstraction via interface allows to change implementation as record, bean, enum, or whatever without breaking compatibility. Example usage:
 AsciiConverterConfig config = AsciiConverterConfig.of().withCaseConversion(
 CaseConversion.LOWER_CASE).withUnmappedCodePoint("[?]").withIncludeControlCharacters(true);
 
See Also:
  • Method Details

    • caseConversion

      CaseConversion caseConversion()
      Returns:
      the configured CaseConversion.
    • withCaseConversion

      AsciiConverterConfig withCaseConversion(CaseConversion conversion)
      Parameters:
      conversion - the CaseConversion to use. Allows you to get the result in UPPER or lower-case what is faster than converting the result to that after ASCII conversion.
      Returns:
      this AsciiConverterConfig for fluent API calls.
    • unmappedCodePoint

      String unmappedCodePoint()
      Returns:
      the configured undefined code-point.
    • withUnmappedCodePoint

      AsciiConverterConfig withUnmappedCodePoint(String ascii)
      Parameters:
      ascii - the String to use for unmapped code-points. The default is the empty String to ignore them. You may use something like "?" or "[?]" instead to make them visible. This String should consist only of 7-bit ASCII characters or your converted result may not be ASCII.
      Returns:
      this AsciiConverterConfig for fluent API calls.
    • includeControlChars

      boolean includeControlChars()
      Returns:
      the configured include-control-characters flag.
    • withIncludeControlChars

      AsciiConverterConfig withIncludeControlChars(boolean include)
      Parameters:
      include - - the ASCII control characters 0x00-0x1F except 0x09 and 0x0A are typically stripped out. This happens if this flag is false. However, provide true to include these control characters into the result.
      Returns:
      this AsciiConverterConfig for fluent API calls.
    • normalizeNumbers

      boolean normalizeNumbers()
      Returns:
      the configured normalize-numbers flag.
    • withNormalizeNumbers

      AsciiConverterConfig withNormalizeNumbers(boolean normalize)
      Parameters:
      normalize - - usually foreign number symbols are added as text, what happens if this flag is false. If you provide true here, sequential number symbols may be added and the result converted to Arabic numbers with ASCII digits. E.g. "ⅩⅭ" ("XC") will result in "90".
      Returns:
      this AsciiConverterConfig for fluent API calls.
    • useLongForms

      boolean useLongForms()
      Returns:
      the configured use-long-forms flag.
    • withUseLongForms

      AsciiConverterConfig withUseLongForms(boolean longForms)
      Parameters:
      longForms - - usually a compact ASCII form is preferred, what happens if this flag is false. If you provide true here, long forms will be preferred for currencies, numbers, and units.
      Returns:
      this AsciiConverterConfig for fluent API calls.
    • of

      static AsciiConverterConfig of()
      Returns:
      a default instance of AsciiConverterConfig.