Class FlatDataStorage<F,K,V>

java.lang.Object
me.hsgamer.topper.storage.flat.core.FlatDataStorage<F,K,V>
All Implemented Interfaces:
me.hsgamer.topper.storage.core.DataStorage<K,V>

public abstract class FlatDataStorage<F,K,V> extends Object implements me.hsgamer.topper.storage.core.DataStorage<K,V>
  • Constructor Details

  • Method Details

    • setupFile

      protected abstract F setupFile(File baseFolder, String name)
    • loadFromFile

      protected abstract Map<String,String> loadFromFile(F file)
    • loadFromFile

      protected abstract Optional<String> loadFromFile(F file, String key)
    • saveFile

      protected abstract void saveFile(F file)
    • setValue

      protected abstract void setValue(F file, String key, String value)
    • removeValue

      protected abstract void removeValue(F file, String key)
    • onRegister

      public final void onRegister()
      Specified by:
      onRegister in interface me.hsgamer.topper.storage.core.DataStorage<F,K>
    • onUnregister

      public final void onUnregister()
      Specified by:
      onUnregister in interface me.hsgamer.topper.storage.core.DataStorage<F,K>
    • load

      public final Map<K,V> load()
      Specified by:
      load in interface me.hsgamer.topper.storage.core.DataStorage<F,K>
    • load

      public Optional<V> load(K key)
      Specified by:
      load in interface me.hsgamer.topper.storage.core.DataStorage<F,K>
    • modify

      public Optional<me.hsgamer.topper.storage.core.DataStorage.Modifier<K,V>> modify()
      Specified by:
      modify in interface me.hsgamer.topper.storage.core.DataStorage<F,K>