Class 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 Detail

      • AbstractStore

        public AbstractStore()
    • Method Detail

      • get

        public Optional<O> get​(K key)
        Description copied from interface: Store
        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)
        Description copied from interface: Store
        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)
        Description copied from interface: Store
        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)
      • internalSet

        protected abstract void internalSet​(K key,
                                            O value)
      • internalRemove

        protected abstract void internalRemove​(K key)