Class DataStoreTypes.DataKind

  • Enclosing class:
    DataStoreTypes

    public static final class DataStoreTypes.DataKind
    extends java.lang.Object
    Represents a separately namespaced collection of storable data items.

    The SDK passes instances of this type to the data store to specify whether it is referring to a feature flag, a user segment, etc. The data store implementation should not look for a specific data kind (such as feature flags), but should treat all data kinds generically.

    • Method Detail

      • getName

        public java.lang.String getName()
        A case-sensitive alphabetic string that uniquely identifies this data kind.

        This is in effect a namespace for a collection of items of the same kind. Item keys must be unique within that namespace. Persistent data store implementations could use this string as part of a composite key or table name.

        Returns:
        the namespace string
      • serialize

        public java.lang.String serialize​(DataStoreTypes.ItemDescriptor item)
        Returns a serialized representation of an item of this kind.

        The SDK uses this function to generate the data that is stored by a PersistentDataStore. Store implementations normally do not need to call it, except in a special case described in the documentation for PersistentDataStore regarding deleted item placeholders.

        Parameters:
        item - an DataStoreTypes.ItemDescriptor describing the object to be serialized
        Returns:
        the serialized representation
        Throws:
        java.lang.ClassCastException - if the object is of the wrong class
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object