1.15.2 Config serialization

Discussion in 'Spigot Plugin Development' started by Xocky, Jan 28, 2020.

  1. How do i serialize a Config? Is it possible?
  2. What do you mean serialize Config? Serialize values to Config? Serialize a Config.yml ? Serialize ...?
  3. Serialize everything inside the config
  4. Yes, it's possible to serialize into a config file, but I've never tried.
  5. What do you mean with string not map?
  6. A config that was serialized into a string not a map
  7. Why don'y you want to serialize as map?
    Is how the API works
  8. Need to transfer it through a redis channel
  9. Maybe using a JSON library (like GSON) to store it as if it was a string?
  10. Still need a solution:/
  11. What I ment is that with GSON you can cast an object to a string and it will be something like this
    Code (Text):
    "city":"New York"
    Using this you can store ANY type of data as an string that it would look like {"name":"John", "age":31, "city":"New York"}
    Then you can use GSON back to get the object from the string
    • Agree Agree x 1