public abstract class Codec<T> extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Codec.EnumC<E extends Enum<E>>
A codec for enums which encodes to/from
Enum.name . |
Modifier and Type | Field and Description |
---|---|
static Codec<Boolean> |
BOOLEAN
A codec for booleans.
|
static Codec<Integer> |
INT
A codec for ints.
|
static Codec<int[]> |
INTS
A codec for int arrays.
|
static Codec<Long> |
LONG
A codec for longs.
|
static Codec<String> |
STRING
A codec for strings.
|
Constructor and Description |
---|
Codec() |
Modifier and Type | Method and Description |
---|---|
abstract T |
decode(String data)
Decodes the supplied string into a value.
|
T |
decode(String data,
T defval)
Decodes the supplied string into a value.
|
abstract String |
encode(T value)
Encodes the supplied value to a string.
|
Copyright © 2019. All rights reserved.