Package org.opensearch.client.json
Class JsonEnum.Deserializer<T extends JsonEnum>
java.lang.Object
org.opensearch.client.json.JsonpDeserializerBase<T>
org.opensearch.client.json.JsonEnum.Deserializer<T>
- All Implemented Interfaces:
JsonpDeserializer<T>
- Enclosing interface:
JsonEnum
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondeserialize(jakarta.json.stream.JsonParser parser, JsonpMapper mapper, jakarta.json.stream.JsonParser.Event event) Deserialize a value.deserialize(String value, jakarta.json.stream.JsonParser parser) Get the enum member for a JSON string valueGet the enum member for a JSON string valueMethods inherited from class org.opensearch.client.json.JsonpDeserializerBase
acceptedEvents, accepts, allAcceptedEvents, nativeEventsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.opensearch.client.json.JsonpDeserializer
deserialize
-
Constructor Details
-
Deserializer
-
-
Method Details
-
deserialize
public T deserialize(jakarta.json.stream.JsonParser parser, JsonpMapper mapper, jakarta.json.stream.JsonParser.Event event) Description copied from interface:JsonpDeserializerDeserialize a value. The value starts at the current state in the JSON stream.- Parameters:
parser- the JSON parsermapper- the JSON-P mapperevent- the current state ofparser, which must be part ofJsonpDeserializer.acceptedEvents()- Returns:
- the parsed value
-
deserialize
Get the enum member for a JSON string value- Parameters:
value- the JSON valueparser- parsing context- Returns:
- the enum member
- Throws:
jakarta.json.stream.JsonParsingException- if no matching enum was found
-
parse
Get the enum member for a JSON string value- Parameters:
value- the JSON value- Returns:
- the enum member
- Throws:
IllegalArgumentException- if no matching enum was found
-