Class CharArray

java.lang.Object
org.apache.commons.dbcp2.datasources.CharArray
All Implemented Interfaces:
Serializable

final class CharArray extends Object implements Serializable
A char array wrapper that does not reveal its contents inadvertently through toString(). In contrast to, for example, AtomicReference which toString()'s its contents. May contain null.
Since:
2.9.0
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • NULL

      static final CharArray NULL
    • chars

      private final char[] chars
  • Constructor Details

    • CharArray

      CharArray(char[] chars)
    • CharArray

      CharArray(String string)
  • Method Details

    • asString

      String asString()
      Converts the value of char array as a String.
      Returns:
      value as a string, may be null.
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • get

      char[] get()
      Gets the value of char array.
      Returns:
      value, may be null.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object