Interface Namespace

All Known Implementing Classes:
ExtensionContext.Namespace

@API(status=MAINTAINED, since="6.2") public interface Namespace
A Namespace is used to provide a scope for data saved within a Store.

Storing data in custom namespaces allows avoiding accidentally mixing data between different users of a store.

Two namespaces are equal if and only if their parts are equal, regardless of their concrete implementation class.

Since:
6.2
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Namespace
    The default, global namespace which allows access to stored data from all users of a store.
  • Method Summary

    Modifier and Type
    Method
    Description
    append(Object... parts)
    Create a new namespace by appending the supplied parts to the existing sequence of parts in this namespace.
    static Namespace
    create(Object... parts)
    Create a namespace which restricts access to data to all users which use the same sequence of parts for creating a namespace.
    Returns the parts of this namespace.
  • Field Details

    • GLOBAL

      static final Namespace GLOBAL
      The default, global namespace which allows access to stored data from all users of a store.
  • Method Details

    • create

      static Namespace create(Object... parts)
      Create a namespace which restricts access to data to all users which use the same sequence of parts for creating a namespace.

      The order of the parts is significant.

      Internally the parts are compared using Object.equals(Object).

    • append

      Namespace append(Object... parts)
      Create a new namespace by appending the supplied parts to the existing sequence of parts in this namespace.
      Returns:
      new namespace; never null
    • getParts

      @API(status=INTERNAL, since="6.2") List<Object> getParts()
      Returns the parts of this namespace.
      Returns:
      the parts of this namespace