public class InMemoryDocumentLibrary extends Object implements DocumentLibrary, Serializable
Constructor and Description |
---|
InMemoryDocumentLibrary(String name) |
Modifier and Type | Method and Description |
---|---|
Document |
get(String key)
Get the document with the supplied key.
|
String |
getName()
Get the name of this library.
|
Document |
put(String key,
Document document)
Store the supplied document at the given key.
|
Document |
putIfAbsent(String key,
Document document)
Store the supplied document at the given key.
|
Document |
remove(String key)
Remove the existing document at the given key.
|
Document |
replace(String key,
Document document)
Replace the existing document at the given key with the document that is supplied.
|
public InMemoryDocumentLibrary(String name)
public String getName()
DocumentLibrary
getName
in interface DocumentLibrary
public Document get(String key)
DocumentLibrary
get
in interface DocumentLibrary
key
- the key or identifier for the documentpublic Document put(String key, Document document)
DocumentLibrary
put
in interface DocumentLibrary
key
- the key or identifier for the documentdocument
- the document that is to be storedpublic Document putIfAbsent(String key, Document document)
DocumentLibrary
putIfAbsent
in interface DocumentLibrary
key
- the key or identifier for the documentdocument
- the document that is to be storedpublic Document replace(String key, Document document)
DocumentLibrary
replace
in interface DocumentLibrary
key
- the key or identifier for the documentdocument
- the document that is to replace the existing documentpublic Document remove(String key)
DocumentLibrary
remove
in interface DocumentLibrary
key
- the key or identifier for the documentCopyright © 2008–2016 JBoss, a division of Red Hat. All rights reserved.