Class Layer1GlobalStorage

java.lang.Object
velox.api.layer1.common.Layer1GlobalStorage

public class Layer1GlobalStorage extends Object
Global storage. Only use it if you don't have other more appropriate ways to store the data. Layer1 modules should use SettingsAccess instead.
  • Constructor Details

    • Layer1GlobalStorage

      public Layer1GlobalStorage()
  • Method Details

    • setStorageCallbacks

      public static void setStorageCallbacks(Function<String,String> valuesGetter, BiConsumer<String,String> valuesSetter)
      Initialize storage backend. Invoked by Bookmap. Plugins should not call this method.
    • set

      public static void set(String key, String value)
      Store value globally.
      Parameters:
      key - key to use. Must be unique and identifiable (e.g. prefix it with your module name).
      value - value to store
    • get

      public static String get(String key)
      Load value from global storage
      Parameters:
      key - key to use. Must be unique and identifiable (e.g. prefix it with your module name).
      Returns:
      previously stored value or null if not found