Class ConfigSerializer

java.lang.Object
dev.ua.theroer.magicutils.config.ConfigSerializer

public class ConfigSerializer extends Object
Handles serialization and deserialization of complex config objects.
  • Method Details

    • serialize

      public static Map<String,Object> serialize(Object obj)
      Serializes an object to a config-friendly map.
      Parameters:
      obj - the object to serialize
      Returns:
      the serialized map representation
    • deserialize

      public static <T> T deserialize(PlatformLogger logger, Map<String,Object> data, Class<T> clazz)
      Deserializes a map to an object.
      Type Parameters:
      T - the type to deserialize to
      Parameters:
      logger - logger for diagnostics
      data - the map data to deserialize
      clazz - the class to deserialize to
      Returns:
      the deserialized object
      Throws:
      SecurityException - if the class is not marked as @ConfigSerializable