Package score

Interface DictDB<K,​V>

  • Type Parameters:
    K - Key type. It shall be String, byte array, Address, Byte, Short, Integer, Long, Character or BigInteger.
    V - Value type. It shall be readable and writable class.

    public interface DictDB<K,​V>
    A dictionary DB is a hash from key to value. Only values of the dictionary DB is recorded in the DB. Keys are not recorded.
    See Also:
    ObjectReader, ObjectWriter
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      V get​(K key)
      Returns the value for a key
      V getOrDefault​(K key, V defaultValue)
      Returns the value for a key or defaultValue if the value is null.
      void set​(K key, V value)
      Sets a value for a key
    • Method Detail

      • set

        void set​(K key,
                 V value)
        Sets a value for a key
        Parameters:
        key - key
        value - value for the key
      • get

        V get​(K key)
        Returns the value for a key
        Parameters:
        key - key
        Returns:
        the value for a key
      • getOrDefault

        V getOrDefault​(K key,
                       V defaultValue)
        Returns the value for a key or defaultValue if the value is null.
        Parameters:
        key - key
        defaultValue - default value
        Returns:
        the value for a key or defaultValue if the value is null.