Class AbstractStore<K,O>

java.lang.Object
org.pac4j.core.util.InitializableObject
org.pac4j.core.store.AbstractStore<K,O>
All Implemented Interfaces:
Store<K,O>
Direct Known Subclasses:
GuavaStore

public abstract class AbstractStore<K,O> extends InitializableObject implements Store<K,O>
Abstract store.
Since:
2.0.0
Author:
Jerome Leleu
  • Constructor Details

    • AbstractStore

      public AbstractStore()
  • Method Details

    • internalInit

      protected void internalInit(boolean forceReinit)
      Internal initialization of the object.
      Specified by:
      internalInit in class InitializableObject
      Parameters:
      forceReinit - a boolean
    • get

      public Optional<O> get(K key)
      Get a value by key.
      Specified by:
      get in interface Store<K,O>
      Parameters:
      key - the key
      Returns:
      the object (optional)
    • set

      public void set(K key, O value)
      Set a value by its key.
      Specified by:
      set in interface Store<K,O>
      Parameters:
      key - the key
      value - the value
    • remove

      public void remove(K key)
      Remove the value associated to the key.
      Specified by:
      remove in interface Store<K,O>
      Parameters:
      key - the key
    • internalGet

      protected abstract Optional<O> internalGet(K key)

      internalGet.

      Parameters:
      key - a K object
      Returns:
      a Optional object
    • internalSet

      protected abstract void internalSet(K key, O value)

      internalSet.

      Parameters:
      key - a K object
      value - a O object
    • internalRemove

      protected abstract void internalRemove(K key)

      internalRemove.

      Parameters:
      key - a K object