Package tripleplay.syncdb
Class Codec<T>
java.lang.Object
tripleplay.syncdb.Codec<T>
- Direct Known Subclasses:
Codec.EnumC
Handles encoding/decoding properties to/from strings.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Codec.EnumC<E extends Enum<E>>
A codec for enums which encodes to/fromEnum.name
. -
Field Summary
Modifier and TypeFieldDescriptionA codec for booleans.A codec for ints.static final Codec<int[]>
A codec for int arrays.A codec for longs.A codec for strings. -
Constructor Summary
-
Method Summary
-
Field Details
-
STRING
A codec for strings. The identity codec. -
INT
A codec for ints. -
INTS
A codec for int arrays. -
LONG
A codec for longs. -
BOOLEAN
A codec for booleans. Encodes to the stringt
orf
.
-
-
Constructor Details
-
Codec
public Codec()
-
-
Method Details
-
encode
Encodes the supplied value to a string. -
decode
Decodes the supplied string into a value. May freak out ifdata
is null. -
decode
Decodes the supplied string into a value. Returnsdefval
ifdata
is null.
-