Interface Savable

All Known Implementing Classes:
District, Government, Jail, Nation, ObjectGroup, PlotGroup, Resident, Town, TownBlock, TownyObject, TownyWorld

public interface Savable
Basic interface that depicts whether an object has a specified save method. Most, if not all, save methods will redirect to a specific method in TownyDataSource. Using the save() method is preferred to future proof against database class changes.
  • Method Details

    • save

      void save()
      Schedules the object to be saved to the database.
    • getObjectDataMap

      @Internal Map<String,Object> getObjectDataMap(SerializationContext context) throws ObjectSaveException
      Parameters:
      context - SerializationContext with information.
      Returns:
      a Map which stores keys and values, meant to be written to a database.
      Throws:
      ObjectSaveException - when something cannot be saved.