Interface JSONCodec<T>
- Type Parameters:
T
- Normalized value type
- All Superinterfaces:
TypeAwareCodec<T,
Void, JSONValueWriter>
A codec capable of performing normalized value conversion with a
JsonWriter
.-
Method Summary
Modifier and TypeMethodDescriptionparseValue
(String str) Parse a String representation into its native format.default T
parseValue
(Void ctx, String str) Deprecated.@NonNull JSONValue
unparseValue
(T value) Return theJSONValue
representation of a native value.void
writeValue
(JSONValueWriter ctx, T value) Serialize specified value with specified JsonWriter.Methods inherited from interface org.opendaylight.yangtools.yang.data.util.codec.TypeAwareCodec
getDataType
-
Method Details
-
writeValue
Serialize specified value with specified JsonWriter..- Specified by:
writeValue
in interfaceTypeAwareCodec<T,
Void, JSONValueWriter> - Parameters:
ctx
- Write contextvalue
- Value in native format- Throws:
IOException
- if the write fails
-
parseValue
Deprecated.UseparseValue(String)
instead.Parse a String representation into its native format..- Specified by:
parseValue
in interfaceTypeAwareCodec<T,
Void, JSONValueWriter> - Parameters:
ctx
- Parse contextstr
- String representation- Returns:
- Value in native format
-
parseValue
Parse a String representation into its native format.- Parameters:
str
- String representation- Returns:
- Value in native format
- Throws:
IllegalArgumentException
- if the value does not parse or pass type validation
-
unparseValue
Return theJSONValue
representation of a native value.- Parameters:
value
- Value in native format- Returns:
- A
JSONValue
- Throws:
IllegalArgumentException
- if the value does not parse or pass type validation
-
parseValue(String)
instead.