Enum Storage

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<Storage>


    public enum Storage
    extends java.lang.Enum<Storage>
    Singleton storage instance used to initialize or clear the storage

    Access a specific storage via instance of this class.

    • Enum Constant Summary

      Enum Constants 
      Enum Constant and Description
      INSTANCE 
    • Enum Constant Detail

      • INSTANCE

        public static final Storage INSTANCE
    • Method Detail

      • values

        public static Storage[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (Storage c : Storage.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static Storage valueOf(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • init

        public static void init(Context context)
        Initializes the storage. This must be called first in order for the storage to work.
        Parameters:
        context - A context which will be used to initialise the storage
      • machineId

        public static MachineIdStorage machineId()
        Provides an instance of MachineIdStorage

        If Storage has not been initialized first this will return dummy storage implementation.

        Returns:
        machine id storage
      • visitorInfo

        public static VisitorInfoStorage visitorInfo()
        Provides an instance of VisitorInfoStorage

        If Storage has not been initialized first this will return mocked storage implementation.

        Returns:
        visitor info storage