@FunctionalInterface public interface SchematicEntry
Document
which exposes a predefined structure of documents usually stored inside
a SchematicDb
.Modifier and Type | Interface and Description |
---|---|
static class |
SchematicEntry.FieldName |
Modifier and Type | Method and Description |
---|---|
default Document |
content()
Return this document's content.
|
static Document |
content(Document entryDocument)
Returns the value of the CONTENT document from a given entry document.
|
static SchematicEntry |
create(String id)
Creates a new empty entry with the given id.
|
static SchematicEntry |
create(String id,
Document content)
Creates a new entry with the given content.
|
default Document |
getMetadata()
Get the metadata associated with this document.
|
default String |
id()
Returns this document's id.
|
static String |
id(Document entryDocument)
Returns the value of the ID from a given entry document.
|
Document |
source()
Returns the original document which is wrapped by this entry.
|
Document source()
Document
instance, never null
default Document getMetadata()
default Document content()
Document
or null.default String id()
NullPointerException
- if this document does not have a metadata sectionstatic SchematicEntry create(String id)
id
- the id of the document, may not be null.SchematicEntry
, never null
static SchematicEntry create(String id, Document content)
id
- the id of the document, may not be null.content
- the id of the document, may not be null.SchematicEntry
, never null
static String id(Document entryDocument)
entryDocument
- a Document
instance representing a schematic entry.String
or null
if there is no SchematicEntry.FieldName.METADATA
document or if that document doesn't have an id.static Document content(Document entryDocument)
entryDocument
- a Document
instance representing a schematic entry.Document
or null
if there is no SchematicEntry.FieldName.CONTENT
document.Copyright © 2008–2016 JBoss, a division of Red Hat. All rights reserved.