public class MemoryBotContext extends java.lang.Object implements BotContext
DEFAULT_NEED_LIST_NAME| Constructor and Description |
|---|
MemoryBotContext() |
| Modifier and Type | Method and Description |
|---|---|
void |
addToListMap(java.lang.String collectionName,
java.lang.String key,
java.io.Serializable... value)
Add one or more arbitrary objects to a list at a specific key in the collection.
|
void |
appendToNamedNeedUriList(java.net.URI uri,
java.lang.String name)
add a need uri to a named need uri list
|
void |
dropCollection(java.lang.String collectionName)
Remove the whole collection from the bot context
|
java.util.List<java.net.URI> |
getNamedNeedUriList(java.lang.String name)
loadFromObjectMap all the need from a named need uri list
|
boolean |
isInNamedNeedUriList(java.net.URI uri,
java.lang.String name) |
boolean |
isNeedKnown(java.net.URI needURI)
Check if need uri is known among all stored need uris
|
boolean |
isNodeKnown(java.net.URI wonNodeURI)
check if a node uri is known among all stored nodes
|
java.util.List<java.lang.Object> |
loadFromListMap(java.lang.String collectionName,
java.lang.String key)
Retrieve all objects from one collection at one key previously added using addToListMap().
|
java.lang.Object |
loadFromObjectMap(java.lang.String collectionName,
java.lang.String key)
Retrieve an object from a collection previously added using saveToObjectMap().
|
java.util.Map<java.lang.String,java.util.List<java.lang.Object>> |
loadListMap(java.lang.String collectionName)
Retrieve a copy of the whole object list map in a collection
|
java.util.Map<java.lang.String,java.lang.Object> |
loadObjectMap(java.lang.String collectionName)
Retrieve a copy of the whole object map of the collection
|
void |
rememberNodeUri(java.net.URI uri)
store a node uri
|
void |
removeFromListMap(java.lang.String collectionName,
java.lang.String key)
Remove all object in the list at a specific map key in the collection
|
void |
removeFromListMap(java.lang.String collectionName,
java.lang.String key,
java.io.Serializable... values)
Remove one or more arbitrary objects from the list at a specific key in the collection.
|
void |
removeFromObjectMap(java.lang.String collectionName,
java.lang.String key)
Remove an object saved at a specific map key in the collection
|
void |
removeLeavesFromListMap(java.lang.String collectionName,
java.io.Serializable... values)
Remove one or more arbitrary objects from the list for all keys in the collection.
|
void |
removeNeedUriFromNamedNeedUriList(java.net.URI uri,
java.lang.String name)
removeFromObjectMap a need uri from a named need uri list
|
void |
removeNodeUri(java.net.URI uri)
removeFromObjectMap a node uri
|
java.util.Set<java.net.URI> |
retrieveAllNeedUris()
Return a set of all known need uris stored in all named need uri lists
|
void |
saveToObjectMap(java.lang.String collectionName,
java.lang.String key,
java.io.Serializable value)
Put an arbitrary single object in the context.
|
public java.util.Set<java.net.URI> retrieveAllNeedUris()
BotContextretrieveAllNeedUris in interface BotContextpublic boolean isNeedKnown(java.net.URI needURI)
BotContextisNeedKnown in interface BotContextpublic void removeNeedUriFromNamedNeedUriList(java.net.URI uri,
java.lang.String name)
BotContextremoveNeedUriFromNamedNeedUriList in interface BotContextpublic void appendToNamedNeedUriList(java.net.URI uri,
java.lang.String name)
BotContextappendToNamedNeedUriList in interface BotContextpublic boolean isInNamedNeedUriList(java.net.URI uri,
java.lang.String name)
isInNamedNeedUriList in interface BotContextpublic java.util.List<java.net.URI> getNamedNeedUriList(java.lang.String name)
BotContextgetNamedNeedUriList in interface BotContextpublic boolean isNodeKnown(java.net.URI wonNodeURI)
BotContextisNodeKnown in interface BotContextpublic void rememberNodeUri(java.net.URI uri)
BotContextrememberNodeUri in interface BotContextpublic void removeNodeUri(java.net.URI uri)
BotContextremoveNodeUri in interface BotContextpublic void dropCollection(java.lang.String collectionName)
BotContextdropCollection in interface BotContextpublic void saveToObjectMap(java.lang.String collectionName,
java.lang.String key,
java.io.Serializable value)
BotContextsaveToObjectMap in interface BotContextpublic final java.lang.Object loadFromObjectMap(java.lang.String collectionName,
java.lang.String key)
BotContextloadFromObjectMap in interface BotContextpublic java.util.Map<java.lang.String,java.lang.Object> loadObjectMap(java.lang.String collectionName)
BotContextloadObjectMap in interface BotContextpublic final void removeFromObjectMap(java.lang.String collectionName,
java.lang.String key)
BotContextremoveFromObjectMap in interface BotContextpublic void addToListMap(java.lang.String collectionName,
java.lang.String key,
java.io.Serializable... value)
BotContextaddToListMap in interface BotContextpublic void removeFromListMap(java.lang.String collectionName,
java.lang.String key,
java.io.Serializable... values)
BotContextremoveFromListMap in interface BotContextpublic void removeLeavesFromListMap(java.lang.String collectionName,
java.io.Serializable... values)
BotContextremoveLeavesFromListMap in interface BotContextpublic java.util.List<java.lang.Object> loadFromListMap(java.lang.String collectionName,
java.lang.String key)
BotContextloadFromListMap in interface BotContextpublic java.util.Map<java.lang.String,java.util.List<java.lang.Object>> loadListMap(java.lang.String collectionName)
BotContextloadListMap in interface BotContextpublic void removeFromListMap(java.lang.String collectionName,
java.lang.String key)
BotContextremoveFromListMap in interface BotContextCopyright © 2018. All Rights Reserved.