Package net.sf.basedb.util.encode
Interface EncoderDecoder
-
- All Known Implementing Classes:
IdentityEncoderDecoder
,TabCrLfEncoderDecoder
,ToSpaceEncoderDecoder
public interface EncoderDecoder
Interface for encoding and decoding strings to make them work in a certain context. For example, in tab-separated text files tabs, newlines, etc. need to be encoded or the number of columns or lines will be incorrect.An encoder is usually paired with a decoder. It is not a requirement that the encoding is symmetrical. If the encoding is symmetrical the result of encoding and then decoding must be equal the original string and so must the result of decoding and then encoding.
It is up to the implementation how null values are handled. Some implementations may not support null and may throw an exception. Note that null value handling must also be symmetrical if
isSymmetrical()
returns true.- Since:
- 2.15
- Author:
- Nicklas
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
decode(String s)
String
encode(String s)
boolean
isSymmetrical()
-