Class CharEscaperBuilder

java.lang.Object
com.google.common.escape.CharEscaperBuilder

@Beta @GwtCompatible @Deprecated(since="2022-12-01") public final class CharEscaperBuilder extends Object
Deprecated.
The Google Guava Core Libraries are deprecated and will not be part of the AEM SDK after April 2023
Simple helper class to build a "sparse" array of objects based on the indexes that were added to it. The array will be from 0 to the maximum index given. All non-set indexes will contain null (so it's not really a sparse array, just a pseudo sparse array). The builder can also return a CharEscaper based on the generated array.
Since:
15.0
  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated.
    Construct a new sparse array builder.
  • Method Summary

    Modifier and Type
    Method
    Description
    addEscape(char c, String r)
    Deprecated.
    Add a new mapping from an index to an object to the escaping.
    addEscapes(char[] cs, String r)
    Deprecated.
    Add multiple mappings at once for a particular index.
    char[][]
    Deprecated.
    Convert this builder into an array of char[]s where the maximum index is the value of the highest character that has been seen.
    Deprecated.
    Convert this builder into a char escaper which is just a decorator around the underlying array of replacement char[]s.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CharEscaperBuilder

      public CharEscaperBuilder()
      Deprecated.
      Construct a new sparse array builder.
  • Method Details

    • addEscape

      public CharEscaperBuilder addEscape(char c, String r)
      Deprecated.
      Add a new mapping from an index to an object to the escaping.
    • addEscapes

      public CharEscaperBuilder addEscapes(char[] cs, String r)
      Deprecated.
      Add multiple mappings at once for a particular index.
    • toArray

      public char[][] toArray()
      Deprecated.
      Convert this builder into an array of char[]s where the maximum index is the value of the highest character that has been seen. The array will be sparse in the sense that any unseen index will default to null.
      Returns:
      a "sparse" array that holds the replacement mappings.
    • toEscaper

      public Escaper toEscaper()
      Deprecated.
      Convert this builder into a char escaper which is just a decorator around the underlying array of replacement char[]s.
      Returns:
      an escaper that escapes based on the underlying array.