Package edu.wpi.grip.core.http
Class ContextStore
- java.lang.Object
-
- edu.wpi.grip.core.http.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.
-
-
-
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. Ifcontext
isnull
, this will do nothing and returnfalse
.- 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. Ifcontext
isnull
, this will returnfalse
.- Parameters:
context
- the context to check- Returns:
- true if the given context has been recorded in this store
-
-