Class JsonWorldIo

java.lang.Object
technology.sola.ecs.io.json.JsonWorldIo
All Implemented Interfaces:
WorldIo

@NullMarked public class JsonWorldIo extends Object implements WorldIo
A reflection free JSON implementation of WorldIo.
  • Constructor Details

    • JsonWorldIo

      public JsonWorldIo(List<technology.sola.json.mapper.JsonMapper<? extends Component>> componentJsonMappers)
      Creates a new JsonWorldIo instance with desired JsonMappers.
      Parameters:
      componentJsonMappers - the JsonMappers to be used during serialization and deserialization
  • Method Details

    • stringify

      public String stringify(World world)
      Description copied from interface: WorldIo
      Serializes a World into a string.
      Specified by:
      stringify in interface WorldIo
      Parameters:
      world - the World to serialize
      Returns:
      the serialized World
    • parse

      public World parse(String worldString)
      Description copied from interface: WorldIo
      Deserializes a string into a World.
      Specified by:
      parse in interface WorldIo
      Parameters:
      worldString - the string to deserialize
      Returns:
      the deserialized World