java.lang.Object com.realtime.crossfire.jxclient.settings.Codec
public class Codec
Utility class to encode arbitrary Strings to fit in a single text line. For
any string s
, encode(s)
is a string that does not
contain \r or \n characters and s.equals(decode(encode(s)))
holds.
Field Summary | |
---|---|
private static java.util.regex.Pattern[] |
PATTERNS_DECODE
Patterns that must be decoded. |
private static java.util.regex.Pattern[] |
PATTERNS_ENCODE
Patterns that must be encoded. |
private static java.lang.String[] |
REPLACEMENTS_DECODE
The replacement strings for PATTERNS_DECODE . |
private static java.lang.String[] |
REPLACEMENTS_ENCODE
The replacement strings for PATTERNS_ENCODE . |
Constructor Summary | |
---|---|
private |
Codec()
Private constructor to prevent instantiation. |
Method Summary | |
---|---|
static java.lang.String |
decode(java.lang.String str)
Decode a string which was encoded by encode(String) . |
static java.lang.String |
encode(java.lang.String str)
Encode a string to make it fit into one line. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
@NotNull private static final java.util.regex.Pattern[] PATTERNS_DECODE
REPLACEMENTS_DECODE
.
@NotNull private static final java.util.regex.Pattern[] PATTERNS_ENCODE
REPLACEMENTS_ENCODE
.
@NotNull private static final java.lang.String[] REPLACEMENTS_DECODE
PATTERNS_DECODE
.
@NotNull private static final java.lang.String[] REPLACEMENTS_ENCODE
PATTERNS_ENCODE
.
Constructor Detail |
---|
private Codec()
Method Detail |
---|
@NotNull public static java.lang.String decode(@NotNull java.lang.String str)
encode(String)
.
str
- The string to be decoded.
encode(String)
@NotNull public static java.lang.String encode(@NotNull java.lang.String str)
str
- The string to be encoded.
decode(String)