Interface StringCodec

All Known Implementing Classes:
StringCodecFactory.IdentEncoding, StringCodecFactory.ISO9075Helper, StringCodecFactory.NameEncoding, StringCodecFactory.UriEncoding

public interface StringCodec
Strategy interface for encoding and decoding strings.

StringCodec objects should not retain state between calls and are therefore reusable. Encoding and decoding should also be thread-safe.

  • Method Summary

    Modifier and Type
    Method
    Description
    decode(String encoded)
    Decodes a string of characters.
    encode(String plain)
    Encodes a string of characters.
  • Method Details

    • encode

      String encode(String plain)
      Encodes a string of characters.
      Parameters:
      plain - the string to encode
      Returns:
      the encoded string
    • decode

      String decode(String encoded)
      Decodes a string of characters. Some encoding strategies are one-way, in which case the decoding might return null.
      Parameters:
      encoded - the previously encoded string
      Returns:
      the decoded string or null if no decoding is possible