Class MyDataEntity

    • Constructor Detail

      • MyDataEntity

        public MyDataEntity()
    • Method Detail

      • fromJson

        public static <T extends MyDataEntity> T fromJson​(String json,
                                                          Class<T> clazz)
        Deserializes an MyDataEntity from JSON.
        Type Parameters:
        T - the generic type (sub class of MyDataEntity)
        Parameters:
        json - the serialized object in JSON notation
        clazz - the generic type (sub class of MyDataEntity)
        Returns:
        the deserialized MyDataEntity
      • getGson

        public static com.google.gson.Gson getGson()
        Gets the gson.
        Returns:
        the gson
      • getGson

        public static com.google.gson.Gson getGson​(boolean pretty)
        Parameters:
        pretty -
        Returns:
        the serialized entity
      • toJson

        public String toJson​(boolean pretty)
        Serializes an MyDataEntity to JSON.
        Parameters:
        pretty - if true, pretty printing is enabled
        Returns:
        the JSON serialized MyDataEntity