Class VerIDSessionSettingsJsonAdapter<T extends VerIDSessionSettings>

    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected abstract void addProperties​(com.fasterxml.jackson.dataformat.cbor.CBORGenerator cborGenerator, T settings)  
      protected abstract T createSettings()  
      T decodeFromCbor​(com.fasterxml.jackson.dataformat.cbor.CBORParser parser)  
      T deserialize​(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.
      void encodeToCbor​(T src, com.fasterxml.jackson.dataformat.cbor.CBORGenerator cborGenerator)  
      protected abstract void parseProperty​(com.fasterxml.jackson.dataformat.cbor.CBORParser parser, T settings, java.lang.String fieldName)  
      com.google.gson.JsonElement serialize​(T 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • VerIDSessionSettingsJsonAdapter

        public VerIDSessionSettingsJsonAdapter()
    • Method Detail

      • createSettings

        protected abstract T createSettings()
      • deserialize

        public T 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.JsonDeserializer
        Gson 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 passing json since that will cause an infinite loop (Gson will call your call-back method again).

        Specified by:
        deserialize in interface com.google.gson.JsonDeserializer<T extends VerIDSessionSettings>
        Parameters:
        json - The Json data being deserialized
        typeOfT - 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 of typeofT
      • serialize

        public com.google.gson.JsonElement serialize​(T src,
                                                     java.lang.reflect.Type typeOfSrc,
                                                     com.google.gson.JsonSerializationContext context)
        Description copied from interface: com.google.gson.JsonSerializer
        Gson 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 the src object. However, you should never invoke it on the src object itself since that will cause an infinite loop (Gson will call your call-back method again).

        Specified by:
        serialize in interface com.google.gson.JsonSerializer<T extends VerIDSessionSettings>
        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.
      • parseProperty

        protected abstract void parseProperty​(com.fasterxml.jackson.dataformat.cbor.CBORParser parser,
                                              T settings,
                                              java.lang.String fieldName)
                                       throws java.lang.Exception
        Throws:
        java.lang.Exception
      • addProperties

        protected abstract void addProperties​(com.fasterxml.jackson.dataformat.cbor.CBORGenerator cborGenerator,
                                              T settings)
                                       throws java.lang.Exception
        Throws:
        java.lang.Exception
      • decodeFromCbor

        public T decodeFromCbor​(com.fasterxml.jackson.dataformat.cbor.CBORParser parser)
                         throws java.lang.Exception
        Specified by:
        decodeFromCbor in interface CborDecoder<T extends VerIDSessionSettings>
        Throws:
        java.lang.Exception
      • encodeToCbor

        public void encodeToCbor​(T src,
                                 com.fasterxml.jackson.dataformat.cbor.CBORGenerator cborGenerator)
                          throws java.lang.Exception
        Specified by:
        encodeToCbor in interface CborEncoder<T extends VerIDSessionSettings>
        Throws:
        java.lang.Exception