Package com.appliedrec.verid.core2.util
Class UserFaceComparisonJsonAdapter
- java.lang.Object
-
- com.appliedrec.verid.core2.util.UserFaceComparisonJsonAdapter
-
- All Implemented Interfaces:
CborCoder<UserFaceComparison>,CborDecoder<UserFaceComparison>,CborEncoder<UserFaceComparison>,com.google.gson.JsonDeserializer<UserFaceComparison>,com.google.gson.JsonSerializer<UserFaceComparison>
public class UserFaceComparisonJsonAdapter extends java.lang.Object implements com.google.gson.JsonSerializer<UserFaceComparison>, com.google.gson.JsonDeserializer<UserFaceComparison>, CborCoder<UserFaceComparison>
-
-
Constructor Summary
Constructors Constructor Description UserFaceComparisonJsonAdapter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description UserFaceComparisondecodeFromCbor(com.fasterxml.jackson.dataformat.cbor.CBORParser cborParser)UserFaceComparisondeserialize(com.google.gson.JsonElement json, java.lang.reflect.Type typeOfT, com.google.gson.JsonDeserializationContext context)Gson invokes this call-back method during deserialization when it encounters a field of the specified type.voidencodeToCbor(UserFaceComparison src, com.fasterxml.jackson.dataformat.cbor.CBORGenerator cborGenerator)com.google.gson.JsonElementserialize(UserFaceComparison src, java.lang.reflect.Type typeOfSrc, com.google.gson.JsonSerializationContext context)Gson invokes this call-back method during serialization when it encounters a field of the specified type.
-
-
-
Field Detail
-
USER_1
public static final java.lang.String USER_1
- See Also:
- Constant Field Values
-
USER_2
public static final java.lang.String USER_2
- See Also:
- Constant Field Values
-
FACE_1
public static final java.lang.String FACE_1
- See Also:
- Constant Field Values
-
FACE_2
public static final java.lang.String FACE_2
- See Also:
- Constant Field Values
-
SCORE
public static final java.lang.String SCORE
- See Also:
- Constant Field Values
-
-
Method Detail
-
deserialize
public UserFaceComparison deserialize(com.google.gson.JsonElement json, java.lang.reflect.Type typeOfT, com.google.gson.JsonDeserializationContext context) throws com.google.gson.JsonParseException
Description copied from interface:com.google.gson.JsonDeserializerGson invokes this call-back method during deserialization when it encounters a field of the specified type.In the implementation of this call-back method, you should consider invoking
JsonDeserializationContext.deserialize(JsonElement, Type)method to create objects for any non-trivial field of the returned object. However, you should never invoke it on the same type passingjsonsince that will cause an infinite loop (Gson will call your call-back method again).- Specified by:
deserializein interfacecom.google.gson.JsonDeserializer<UserFaceComparison>- Parameters:
json- The Json data being deserializedtypeOfT- The type of the Object to deserialize to- Returns:
- a deserialized object of the specified type typeOfT which is a subclass of
T - Throws:
com.google.gson.JsonParseException- if json is not in the expected format oftypeofT
-
serialize
public com.google.gson.JsonElement serialize(UserFaceComparison src, java.lang.reflect.Type typeOfSrc, com.google.gson.JsonSerializationContext context)
Description copied from interface:com.google.gson.JsonSerializerGson invokes this call-back method during serialization when it encounters a field of the specified type.In the implementation of this call-back method, you should consider invoking
JsonSerializationContext.serialize(Object, Type)method to create JsonElements for any non-trivial field of thesrcobject. However, you should never invoke it on thesrcobject itself since that will cause an infinite loop (Gson will call your call-back method again).- Specified by:
serializein interfacecom.google.gson.JsonSerializer<UserFaceComparison>- Parameters:
src- the object that needs to be converted to Json.typeOfSrc- the actual type (fully genericized version) of the source object.- Returns:
- a JsonElement corresponding to the specified object.
-
decodeFromCbor
public UserFaceComparison decodeFromCbor(com.fasterxml.jackson.dataformat.cbor.CBORParser cborParser) throws java.lang.Exception
- Specified by:
decodeFromCborin interfaceCborDecoder<UserFaceComparison>- Throws:
java.lang.Exception
-
encodeToCbor
public void encodeToCbor(UserFaceComparison src, com.fasterxml.jackson.dataformat.cbor.CBORGenerator cborGenerator) throws java.lang.Exception
- Specified by:
encodeToCborin interfaceCborEncoder<UserFaceComparison>- Throws:
java.lang.Exception
-
-