Class Layer1GlobalStorage

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

public class Layer1GlobalStorage
extends java.lang.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 Summary

    Constructors 
    Constructor Description
    Layer1GlobalStorage()  
  • Method Summary

    Modifier and Type Method Description
    static java.lang.String get​(java.lang.String key)
    Load value from global storage
    static void set​(java.lang.String key, java.lang.String value)
    Store value globally.
    static void setStorageCallbacks​(java.util.function.Function<java.lang.String,​java.lang.String> valuesGetter, java.util.function.BiConsumer<java.lang.String,​java.lang.String> valuesSetter)
    Initialize storage backend.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • setStorageCallbacks

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

      public static void set​(java.lang.String key, java.lang.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 java.lang.String get​(java.lang.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