Interface Storage

  • All Superinterfaces:
    IntermediateStorage

    public interface Storage
    extends IntermediateStorage
    This interface handles the storage of StorageProviders KeyValue pairs. Setting a new key with the Storage also sets the type for this key. e.g. a key that has been set with setLong(key,value) can not be set with setString(key,value) again.
    Since:
    10.0.34
    • Method Detail

      • store

        void store()
            throws PersistencyException
        Stores the changes for the instance of this StorageProvider.
        Throws:
        PersistencyException - is thrown on errors while persisting. Such as the StorageProvider that the KeyValue pairs belong to, is not persisted.
        NOTE: Not all StorageProvider needs to be persited to store the KeyValue pairs.
        Since:
        10.0.34
      • setString

        Storage setString​(java.lang.String key,
                          java.lang.String value)
                   throws WrongTypeException
        Sets the KeyValue pair for this Storage. The value type is String.
        Specified by:
        setString in interface IntermediateStorage
        Parameters:
        key - the key
        value - the String value
        Returns:
        this Storage instance
        Throws:
        WrongTypeException - is thrown when the type String is wrong for this key
        Since:
        10.0.34
      • setLong

        Storage setLong​(java.lang.String key,
                        java.lang.Long value)
                 throws WrongTypeException
        Sets the KeyValue pair for this Storage. The value type is Long.
        Specified by:
        setLong in interface IntermediateStorage
        Parameters:
        key - the key
        value - the Long value
        Returns:
        this Storage instance
        Throws:
        WrongTypeException - is thrown when the type Long is wrong for this key
        Since:
        10.0.34
      • setDouble

        Storage setDouble​(java.lang.String key,
                          java.lang.Double value)
                   throws WrongTypeException
        Sets the KeyValue pair for this Storage. The value type is Double.
        Specified by:
        setDouble in interface IntermediateStorage
        Parameters:
        key - the key
        value - the Double value
        Returns:
        this Storage instance
        Throws:
        WrongTypeException - is thrown when the type Double is wrong for this key
        Since:
        10.0.34
      • setDate

        Storage setDate​(java.lang.String key,
                        java.util.Date value)
                 throws WrongTypeException
        Sets the KeyValue pair for this Storage. The value type is Date.
        Specified by:
        setDate in interface IntermediateStorage
        Parameters:
        key - the key
        value - the Date value
        Returns:
        this Storage instance
        Throws:
        WrongTypeException - is thrown when the type Date is wrong for this key
        Since:
        10.0.34
      • setBoolean

        Storage setBoolean​(java.lang.String key,
                           java.lang.Boolean value)
                    throws WrongTypeException
        Sets the KeyValue pair for this Storage. The value type is Boolean.
        Specified by:
        setBoolean in interface IntermediateStorage
        Parameters:
        key - the key
        value - the Boolean value
        Returns:
        this Storage instance
        Throws:
        WrongTypeException - is thrown when the type Boolean is wrong for this key
        Since:
        10.0.34
      • setEncryptedString

        Storage setEncryptedString​(java.lang.String key,
                                   java.lang.String value)
                            throws WrongTypeException
        Sets the KeyValue pair for this Storage. The value type is String. This string will be saved encrypted.
        Specified by:
        setEncryptedString in interface IntermediateStorage
        Parameters:
        key - the key
        value - the String value
        Returns:
        this Storage instance
        Throws:
        WrongTypeException - is thrown when the type String is wrong for this key or the type of the key is an unencrypted String
        Since:
        10.0.102