Class ContextStore


  • public class ContextStore
    extends java.lang.Object
    Keeps a record of contexts claimed by HTTP request handlers.
    • Constructor Summary

      Constructors 
      Constructor Description
      ContextStore()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean contains​(java.lang.String context)
      Checks if the given context has been recorded in this store.
      boolean erase​(java.lang.String context)
      Erases the given context from this store, if it's present.
      void record​(java.lang.String context)
      Records the given context.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ContextStore

        public ContextStore()
    • Method Detail

      • record

        public void record​(@Nonnull
                           java.lang.String context)
                    throws java.lang.IllegalArgumentException
        Records the given context.
        Parameters:
        context - the context to record. This cannot be null.
        Throws:
        java.lang.IllegalArgumentException - if the given context has already been claimed
      • erase

        public boolean erase​(@Nullable
                             java.lang.String context)
        Erases the given context from this store, if it's present. If context is null, this will do nothing and return false.
        Parameters:
        context - the context to erase
        Returns:
        true if the context was erased, false if it wasn't erased or if it wasn't present to begin with.
      • contains

        public boolean contains​(@Nullable
                                java.lang.String context)
        Checks if the given context has been recorded in this store. If context is null, this will return false.
        Parameters:
        context - the context to check
        Returns:
        true if the given context has been recorded in this store