Package dev.drtheo.autojson.adapter
Interface JsonDeserializationContext
- All Superinterfaces:
JsonContext,SchemaHolder
- All Known Implementing Classes:
JsonStringParser
-
Method Summary
Modifier and TypeMethodDescriptiondefault <T> TDecodes the value in the current context.default <T> TDecodes the value in the current context.<T> TDecodes the value in the current context.<T> TdecodeCustom(Type type, @NotNull Schema<T> schema) Decodes the value in the current context.Methods inherited from interface dev.drtheo.autojson.adapter.JsonContext
auto, schema, schemaHolder
-
Method Details
-
decodeBuiltIn
<T> T decodeBuiltIn()Decodes the value in the current context.- Type Parameters:
T- the type of the object.- Returns:
- The decoded built-in object.
- See Also:
- Implementation Note:
- Should only be used for built-in objects!
-
decode
Decodes the value in the current context.- Type Parameters:
T- the type of the object.- Parameters:
type- the type of the object to decode.- Returns:
- The decoded object.
- Implementation Note:
- This method prefers the built-in values over
PrimitiveSchemas. Consider usingdecode(Type, Schema)if you want to prioritize the schemas over built-in types.
-
decode
Decodes the value in the current context.- Type Parameters:
T- the type of the object.- Parameters:
type- the type of the object to decode.- Returns:
- The decoded object.
- Throws:
IllegalArgumentException- when the type is non-built-in and the provded schema isnull.
-
decodeCustom
Decodes the value in the current context.- Type Parameters:
T- the type of the object.- Parameters:
type- the type of the object to decode.schema- the schema used to decode the value.- Returns:
- The decoded non-built-in object.
- Implementation Note:
- Should only be used for non-built-in objects!
-