Package edu.wpi.grip.core.http
Class ContextStore
- java.lang.Object
-
- edu.wpi.grip.core.http.ContextStore
-
public class ContextStore extends java.lang.ObjectKeeps 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 booleancontains(java.lang.String context)Checks if the given context has been recorded in this store.booleanerase(java.lang.String context)Erases the given context from this store, if it's present.voidrecord(java.lang.String context)Records the given context.
-
-
-
Method Detail
-
record
public void record(@Nonnull java.lang.String context) throws java.lang.IllegalArgumentExceptionRecords 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. Ifcontextisnull, 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. Ifcontextisnull, this will returnfalse.- Parameters:
context- the context to check- Returns:
- true if the given context has been recorded in this store
-
-