|
ModeShape Distribution 3.0.0.Beta4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.infinispan.schematic.internal.SchematicEntryLiteral
@SerializeWith(value=SchematicEntryLiteral.Externalizer.class) public class SchematicEntryLiteral
The primary implementation of SchematicEntry
.
AtomicHashMap
Nested Class Summary | |
---|---|
static class |
SchematicEntryLiteral.Externalizer
The Externalizer for SchematicEntryLiteral instances. |
protected static class |
SchematicEntryLiteral.FieldPath
|
Nested classes/interfaces inherited from interface org.infinispan.schematic.SchematicEntry |
---|
SchematicEntry.FieldName |
Constructor Summary | |
---|---|
|
SchematicEntryLiteral()
|
protected |
SchematicEntryLiteral(MutableDocument document)
|
|
SchematicEntryLiteral(String key)
|
|
SchematicEntryLiteral(String key,
boolean isCopy)
|
Method Summary | |
---|---|
Document |
asDocument()
Get the representation of this entry as a document, which will include the metadata and content
as nested documents. |
void |
commit()
|
SchematicEntryLiteral |
copyForWrite()
|
protected MutableDocument |
data()
|
org.infinispan.atomic.Delta |
delta()
|
EditableDocument |
editDocumentContent()
Get an editable document , when the content is a document . |
EditableDocument |
editMetadata()
Get an editable metadata document . |
Object |
getContent()
Return this value's content. |
Binary |
getContentAsBinary()
Get this value's content, if it is a Binary object. |
Document |
getContentAsDocument()
Get this value's content, if it is a Document object. |
String |
getContentType()
Get the media type describing the content. |
protected SchematicEntryDelta |
getDelta()
|
Document |
getMetadata()
Get the metadata associated with this value. |
SchematicEntry |
getProxy(org.infinispan.Cache<String,SchematicEntry> cache,
String mapKey,
org.infinispan.context.FlagContainer flagContainer)
Builds a thread-safe proxy for this instance so that concurrent reads are isolated from writes. |
boolean |
hasBinaryContent()
Return true if the SchematicEntry.getContent() method would return a Binary (or SchematicEntry.getContentAsBinary() would
return a non-null value). |
boolean |
hasDocumentContent()
Return true if the SchematicEntry.getContent() method would return a Document (or SchematicEntry.getContentAsDocument()
would return a non-null value). |
void |
initForWriting()
Initializes the delta instance to start recording changes. |
void |
markRemoved(boolean b)
|
protected MutableDocument |
mutableMetadata()
|
static SchematicEntry |
newInstance(org.infinispan.Cache<String,SchematicEntry> cache,
String key)
Construction only allowed through this factory method. |
void |
setContent(Binary content,
Document metadata,
String defaultContentType)
Set the content for this value to be the supplied Binary data described by the supplied content type. |
void |
setContent(Document content,
Document metadata,
String defaultContentType)
Set the content for this value to be the supplied Document and set the content type to be " application/json ". |
protected Object |
setContent(Object content)
|
protected void |
setMetadata(Document metadata,
String defaultContentType)
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SchematicEntryLiteral()
public SchematicEntryLiteral(String key)
public SchematicEntryLiteral(String key, boolean isCopy)
protected SchematicEntryLiteral(MutableDocument document)
Method Detail |
---|
public static SchematicEntry newInstance(org.infinispan.Cache<String,SchematicEntry> cache, String key)
SchematicEntryLookup.getSchematicValue(Cache, String)
.
cache
- underlying cachekey
- key under which the schematic value exists
public SchematicEntryLiteral copyForWrite()
protected final MutableDocument data()
public String toString()
toString
in class Object
public void initForWriting()
public SchematicEntry getProxy(org.infinispan.Cache<String,SchematicEntry> cache, String mapKey, org.infinispan.context.FlagContainer flagContainer)
cache
- the cachemapKey
- the keyflagContainer
- the flag container
SchematicEntryProxy
public void markRemoved(boolean b)
public org.infinispan.atomic.Delta delta()
delta
in interface org.infinispan.atomic.DeltaAware
protected SchematicEntryDelta getDelta()
public void commit()
commit
in interface org.infinispan.atomic.DeltaAware
public Document getMetadata()
SchematicEntry
getMetadata
in interface SchematicEntry
protected MutableDocument mutableMetadata()
public String getContentType()
SchematicEntry
getContentType
in interface SchematicEntry
public Object getContent()
SchematicEntry
Document
or Binary
.
Note that this method will return a non-null value only if the SchematicEntry.hasDocumentContent()
method
returns true
.
getContent
in interface SchematicEntry
Document
object, or null if there is no contentpublic Document getContentAsDocument()
SchematicEntry
SchematicEntry.hasDocumentContent()
returns true
, and is therefore equivalent to the following:
return hasDocumentContent() ? (Document)getContent() : null;
getContentAsDocument
in interface SchematicEntry
Document
content, or null if there is no content or the content is a Binary
valuepublic Binary getContentAsBinary()
SchematicEntry
SchematicEntry.hasDocumentContent()
returns false
, and is therefore equivalent to the following:
return hasDocumentContent() ? (Binary)getContent() : null;
getContentAsBinary
in interface SchematicEntry
Binary
content, or null if there is no content or if the content is a Document
public boolean hasDocumentContent()
SchematicEntry
true
if the SchematicEntry.getContent()
method would return a Document (or SchematicEntry.getContentAsDocument()
would return a non-null value).
This is equivalent to the following:
return getContent() instanceof Document;
hasDocumentContent
in interface SchematicEntry
true
if the content is a Document, or false
otherwisepublic boolean hasBinaryContent()
SchematicEntry
true
if the SchematicEntry.getContent()
method would return a Binary (or SchematicEntry.getContentAsBinary()
would
return a non-null value).
This is equivalent to the following:
return getContent() instanceof Binary;
hasBinaryContent
in interface SchematicEntry
true
if the content is a Binary value, or false
otherwiseprotected Object setContent(Object content)
protected void setMetadata(Document metadata, String defaultContentType)
public void setContent(Document content, Document metadata, String defaultContentType)
SchematicEntry
application/json
".
setContent
in interface SchematicEntry
content
- the Document representing the JSON content; may not be nullmetadata
- the Document representing the metadata; may be nulldefaultContentType
- the value for the MIME type describing the content that should be used if the metadata does not
already contain a "contentType" field, and typically Schematic.ContentTypes.JSON
, Schematic.ContentTypes.JSON_SCHEMA
,
or Schematic.ContentTypes.BSON
; may not be nullpublic void setContent(Binary content, Document metadata, String defaultContentType)
SchematicEntry
Binary
data described by the supplied content type.
setContent
in interface SchematicEntry
content
- the Binary representation of the content; may not be nullmetadata
- the Document representing the metadata; may be nulldefaultContentType
- the value for the MIME type describing the content that should be used if the metadata does not
already contain a "contentType" field, and typically Schematic.ContentTypes.JSON
, Schematic.ContentTypes.JSON_SCHEMA
,
or Schematic.ContentTypes.BSON
; may not be nullpublic EditableDocument editDocumentContent()
SchematicEntry
editable document
, when the content is a document
. The client
is expected to make these edits within the context of a transaction, and the edits will be saved when the transaction is
committed.
editDocumentContent
in interface SchematicEntry
SchematicEntry.editMetadata()
public EditableDocument editMetadata()
SchematicEntry
editable metadata document
. The client is expected to make these edits within the context
of a transaction, and the edits will be saved when the transaction is committed.
editMetadata
in interface SchematicEntry
SchematicEntry.editDocumentContent()
public Document asDocument()
SchematicEntry
metadata
and content
as nested documents.
asDocument
in interface SchematicEntry
|
ModeShape Distribution 3.0.0.Beta4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |