public interface Decoder<T>
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> List<T>static booleanboolean_(dev.mccue.json.Json json) decode(dev.mccue.json.Json json) static doubledouble_(dev.mccue.json.Json json) static <T> Tstatic floatfloat_(dev.mccue.json.Json json) static <T> Tstatic intint_(dev.mccue.json.Json json) static longlong_(dev.mccue.json.Json json) default <R> Decoder<R>static <T> Tnull_(dev.mccue.json.Json json) static <T> Decoder<T>static <T> Decoder<T>static <T> Tstatic <T> Optional<T>optionalField(dev.mccue.json.Json json, String fieldName, Decoder<? extends T> valueDecoder) static <T> ToptionalField(dev.mccue.json.Json json, String fieldName, Decoder<? extends T> valueDecoder, T defaultValue) static <T> Optional<T>optionalNullableField(dev.mccue.json.Json json, String fieldName, Decoder<? extends T> valueDecoder) static <T> ToptionalNullableField(dev.mccue.json.Json json, String fieldName, Decoder<? extends T> valueDecoder, T defaultValue) static <T> ToptionalNullableField(dev.mccue.json.Json json, String fieldName, Decoder<? extends T> valueDecoder, T whenFieldMissing, T whenFieldNull) static Stringstring(dev.mccue.json.Json json)
-
Method Details
-
decode
- Throws:
JsonDecodingException
-
map
-
of
-
string
- Throws:
JsonDecodingException
-
boolean_
- Throws:
JsonDecodingException
-
int_
- Throws:
JsonDecodingException
-
long_
- Throws:
JsonDecodingException
-
float_
- Throws:
JsonDecodingException
-
double_
- Throws:
JsonDecodingException
-
null_
- Throws:
JsonDecodingException
-
array
static <T> List<T> array(dev.mccue.json.Json json, Decoder<? extends T> itemDecoder) throws JsonDecodingException - Throws:
JsonDecodingException
-
object
static <T> Map<String,T> object(dev.mccue.json.Json json, Decoder<? extends T> valueDecoder) throws JsonDecodingException - Throws:
JsonDecodingException
-
field
static <T> T field(dev.mccue.json.Json json, String fieldName, Decoder<? extends T> valueDecoder) throws JsonDecodingException - Throws:
JsonDecodingException
-
optionalField
static <T> T optionalField(dev.mccue.json.Json json, String fieldName, Decoder<? extends T> valueDecoder, T defaultValue) throws JsonDecodingException - Throws:
JsonDecodingException
-
optionalField
static <T> Optional<T> optionalField(dev.mccue.json.Json json, String fieldName, Decoder<? extends T> valueDecoder) throws JsonDecodingException - Throws:
JsonDecodingException
-
optionalNullableField
static <T> Optional<T> optionalNullableField(dev.mccue.json.Json json, String fieldName, Decoder<? extends T> valueDecoder) throws JsonDecodingException - Throws:
JsonDecodingException
-
optionalNullableField
static <T> T optionalNullableField(dev.mccue.json.Json json, String fieldName, Decoder<? extends T> valueDecoder, T defaultValue) throws JsonDecodingException - Throws:
JsonDecodingException
-
optionalNullableField
static <T> T optionalNullableField(dev.mccue.json.Json json, String fieldName, Decoder<? extends T> valueDecoder, T whenFieldMissing, T whenFieldNull) throws JsonDecodingException - Throws:
JsonDecodingException
-
index
static <T> T index(dev.mccue.json.Json json, int index, Decoder<? extends T> valueDecoder) throws JsonDecodingException - Throws:
JsonDecodingException
-
nullable
-
nullable
-
oneOf
static <T> T oneOf(dev.mccue.json.Json json, Decoder<? extends T> decoderA, Decoder<? extends T> decoderB) throws JsonDecodingException - Throws:
JsonDecodingException
-