java.lang.Object
org.junit.platform.engine.support.store.Namespace

@API(status=EXPERIMENTAL, since="1.13") public class Namespace extends Object
A Namespace is used to provide a scope for data saved by extensions within a NamespacedHierarchicalStore.

Storing data in custom namespaces allows extensions to avoid accidentally mixing data between extensions or across different invocations within the lifecycle of a single extension.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Namespace
    The default, global namespace which allows access to stored data from all extensions.
  • 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 extensions which use the same sequence of parts for creating a namespace.
    static Namespace
    create(List<Object> objects)
    Create a namespace which restricts access to data to all extensions which use the same sequence of objects for creating a namespace.
    boolean
     
    int
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • GLOBAL

      public static final Namespace GLOBAL
      The default, global namespace which allows access to stored data from all extensions.
  • Method Details

    • create

      public static Namespace create(Object... parts)
      Create a namespace which restricts access to data to all extensions 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).

    • create

      public static Namespace create(List<Object> objects)
      Create a namespace which restricts access to data to all extensions which use the same sequence of objects for creating a namespace.

      The order of the objects is significant.

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

    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • append

      public 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