Class EntrySerializer

  • All Implemented Interfaces:
    com.google.gson.JsonDeserializer<CMAEntry>, com.google.gson.JsonSerializer<CMAEntry>

    public class EntrySerializer
    extends java.lang.Object
    implements com.google.gson.JsonSerializer<CMAEntry>, com.google.gson.JsonDeserializer<CMAEntry>
    Serialize an entry from Contentful
    • Constructor Summary

      Constructors 
      Constructor Description
      EntrySerializer()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      CMAEntry deserialize​(com.google.gson.JsonElement json, java.lang.reflect.Type type, com.google.gson.JsonDeserializationContext context)  
      com.google.gson.JsonElement serialize​(CMAEntry src, java.lang.reflect.Type type, com.google.gson.JsonSerializationContext context)
      Make sure all fields are mapped in the locale - value way.
      • Methods inherited from class java.lang.Object

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

      • EntrySerializer

        public EntrySerializer()
    • Method Detail

      • serialize

        public com.google.gson.JsonElement serialize​(CMAEntry src,
                                                     java.lang.reflect.Type type,
                                                     com.google.gson.JsonSerializationContext context)
        Make sure all fields are mapped in the locale - value way.
        Specified by:
        serialize in interface com.google.gson.JsonSerializer<CMAEntry>
        Parameters:
        src - the source to be edited.
        type - the type to be used.
        context - the json context to be changed.
        Returns:
        a created json element.
      • deserialize

        public CMAEntry deserialize​(com.google.gson.JsonElement json,
                                    java.lang.reflect.Type type,
                                    com.google.gson.JsonDeserializationContext context)
                             throws com.google.gson.JsonParseException
        Specified by:
        deserialize in interface com.google.gson.JsonDeserializer<CMAEntry>
        Throws:
        com.google.gson.JsonParseException