Class ConfigObjectSerializer<T>

java.lang.Object
net.darkhax.pricklemc.common.api.config.ConfigObjectSerializer<T>
Type Parameters:
T - The type of object being serialized.

public class ConfigObjectSerializer<T> extends Object
A serializer that will map an object to config property adapters and make the serializable.
  • Constructor Details

    • ConfigObjectSerializer

      public ConfigObjectSerializer(PropertyResolver propertyResolver, T dataObj)
  • Method Details

    • write

      public void write(com.google.gson.stream.JsonWriter out) throws IOException
      Writes the config object to a JSON writer.
      Parameters:
      out - The writer that data should be written to.
      Throws:
      IOException - This may be raised if a fatal error is encountered while writing the data.
    • read

      public void read(com.google.gson.stream.JsonReader in) throws IOException
      Reads JSON data and updates the properties on the config object.
      Parameters:
      in - The input reader.
      Throws:
      IOException - This may be raised if a fatal error is encountered while reading the data.