public class PipelineDocument
extends java.lang.Object
implements com.lucidworks.apollo.aggregation.Aggregatable, java.io.Serializable
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
F_RAW_CONTENT |
static java.lang.String |
F_RESERVED_PREFIX |
static java.lang.String |
F_SEPARATOR |
static java.util.HashSet<java.lang.String> |
JSON_FIELD_SET |
Constructor and Description |
---|
PipelineDocument() |
PipelineDocument(PipelineDocument other) |
PipelineDocument(java.lang.String id) |
PipelineDocument(java.lang.String id,
java.util.List<PipelineField> fields,
java.util.Map<java.lang.String,java.lang.String> metadata,
java.util.List<Command> commands,
java.util.Map<java.lang.String,java.util.Set<java.lang.String>> hints) |
Modifier and Type | Method and Description |
---|---|
PipelineDocument |
addCommand(Command c) |
PipelineDocument |
addCommand(java.lang.String cmd,
java.util.Map<java.lang.String,java.lang.String> params) |
void |
addCommands(java.util.List<Command> commands) |
PipelineDocument |
addField(PipelineField fld) |
PipelineDocument |
addField(java.lang.String name,
java.lang.Object value)
This will add a field to the document.
|
PipelineDocument |
addField(java.lang.String name,
java.lang.Object value,
java.util.List<Annotation> annotations) |
PipelineDocument |
addField(java.lang.String name,
java.lang.Object value,
java.lang.String... meta) |
PipelineDocument |
addFieldIfDifferent(PipelineField fld) |
PipelineDocument |
addFieldIfDifferent(java.lang.String name,
java.lang.Object value,
java.util.List<Annotation> annotations) |
PipelineDocument |
addFieldIfDifferent(java.lang.String name,
java.lang.Object value,
java.lang.String... meta) |
PipelineDocument |
addFields(java.util.Collection<PipelineField> fields) |
com.lucidworks.apollo.aggregation.Aggregatable |
addFields(java.lang.String field,
java.util.Collection<?> values) |
PipelineDocument |
addHint(java.lang.String name,
java.lang.String tag) |
PipelineDocument |
addHints(java.lang.String name,
java.util.Collection<java.lang.String> tags) |
PipelineDocument |
addHints(java.lang.String name,
java.lang.String... tags) |
PipelineDocument |
addMetadata(java.lang.String name,
java.lang.String value) |
com.lucidworks.apollo.aggregation.Aggregatable |
clear() |
void |
copyField(java.lang.String src,
java.lang.String dest) |
boolean |
equals(java.lang.Object o) |
java.util.Set<java.lang.String> |
getAllFieldNames()
This method returns all field names, including those that
are reserved for internal use.
|
java.util.List<Command> |
getCommands() |
byte[] |
getContent() |
java.util.Set<java.lang.String> |
getFieldNames()
This method returns a subset of field names excluding those that
are reserved for internal use.
|
java.util.Map<java.lang.String,java.util.List<PipelineField>> |
getFields()
Return all fields as an (unmodifiable) Map.
|
java.util.List<PipelineField> |
getFields(java.lang.String name) |
java.util.List<java.lang.Object> |
getFieldValues(java.lang.String name) |
java.util.Set<java.lang.String> |
getFilteredFieldNames(java.lang.String... excludePrefixes)
Returns a filtered subset of field names, where names that
start with one of excludePrefixes are excluded.
|
PipelineField |
getFirstField(java.lang.String name) |
java.lang.Object |
getFirstFieldValue(java.lang.String name) |
java.util.List<PipelineField> |
getFlattenedFields() |
java.util.Map<java.lang.String,java.util.Set<java.lang.String>> |
getHints() |
java.util.Set<java.lang.String> |
getHints(java.lang.String name) |
java.lang.String |
getId() |
PipelineField |
getLastField(java.lang.String name) |
java.util.Map<java.lang.String,java.lang.String> |
getMetadata() |
java.lang.String |
getMetadata(java.lang.String name) |
java.util.Set<java.lang.String> |
getMetadataNames() |
java.util.Set<java.lang.String> |
getReservedFieldNames()
This method returns a subset of field names that are reserved for internal use,
i.e.
|
boolean |
hasField(java.lang.String name)
Return true if this document has the given field.
|
int |
hashCode() |
boolean |
hasHint(java.lang.String name,
java.lang.String tag) |
boolean |
hasMetadata(java.lang.String name) |
static java.lang.String |
metadataKey(java.lang.String type,
java.lang.String name,
java.lang.String... additionalNames)
Prefix a key with our reserved prefix
F_RESERVED_PREFIX and join remaining parts with underscores |
static PipelineDocument |
newCommit() |
static PipelineDocument |
newDelete(java.lang.String id,
boolean commit) |
static PipelineDocument |
newDeleteByQuery(java.lang.String query,
boolean commit) |
static PipelineDocument |
newDocument() |
static PipelineDocument |
newDocument(java.lang.String id) |
java.util.Set<java.lang.String> |
removeAllHints(java.lang.String name) |
PipelineDocument |
removeCommands() |
PipelineDocument |
removeFields(java.lang.String name)
Remove all fields from document that match the given field name.
|
boolean |
removeHint(java.lang.String name,
java.lang.String tag) |
boolean |
removeHints(java.lang.String name,
java.util.Collection<java.lang.String> tags) |
boolean |
removeHints(java.lang.String name,
java.lang.String... tags) |
PipelineDocument |
removeMetadata(java.lang.String name) |
void |
renameField(java.lang.String name,
java.lang.String newName) |
void |
setContent(byte[] data) |
PipelineDocument |
setField(java.lang.String name,
java.lang.Object value)
Set the value of the given field to the given value.
|
PipelineDocument |
setField(java.lang.String name,
java.lang.Object value,
java.util.List<Annotation> annotations) |
PipelineDocument |
setField(java.lang.String name,
java.lang.Object value,
java.lang.String... meta) |
void |
setFields(java.util.Map<java.lang.String,java.util.List<PipelineField>> fields)
Set all fields for this document by clearing existing fields and adding
all content from the given fields Map.
|
com.lucidworks.apollo.aggregation.Aggregatable |
setFields(java.lang.String field,
java.util.Collection<?> values) |
PipelineDocument |
setHints(java.lang.String name,
java.util.Collection<java.lang.String> tags) |
PipelineDocument |
setHints(java.lang.String name,
java.lang.String... tags) |
PipelineDocument |
setId(java.lang.String id) |
void |
setMetadata(java.util.Map<java.lang.String,java.lang.String> metadata) |
java.lang.String |
toString() |
public static final java.lang.String F_RAW_CONTENT
public static final java.lang.String F_RESERVED_PREFIX
public static final java.lang.String F_SEPARATOR
public static final java.util.HashSet<java.lang.String> JSON_FIELD_SET
public PipelineDocument()
public PipelineDocument(java.lang.String id)
public PipelineDocument(java.lang.String id, java.util.List<PipelineField> fields, java.util.Map<java.lang.String,java.lang.String> metadata, java.util.List<Command> commands, java.util.Map<java.lang.String,java.util.Set<java.lang.String>> hints)
public PipelineDocument(PipelineDocument other)
public java.lang.String getId()
public java.util.Map<java.lang.String,java.lang.String> getMetadata()
public java.lang.String getMetadata(java.lang.String name)
public boolean hasMetadata(java.lang.String name)
public java.util.Set<java.lang.String> getMetadataNames()
public void setMetadata(java.util.Map<java.lang.String,java.lang.String> metadata)
public PipelineDocument addMetadata(java.lang.String name, java.lang.String value)
public PipelineDocument removeMetadata(java.lang.String name)
public PipelineDocument addHint(java.lang.String name, java.lang.String tag)
public PipelineDocument addHints(java.lang.String name, java.util.Collection<java.lang.String> tags)
public PipelineDocument addHints(java.lang.String name, java.lang.String... tags)
public PipelineDocument setHints(java.lang.String name, java.util.Collection<java.lang.String> tags)
public PipelineDocument setHints(java.lang.String name, java.lang.String... tags)
public java.util.Set<java.lang.String> getHints(java.lang.String name)
public boolean hasHint(java.lang.String name, java.lang.String tag)
public java.util.Map<java.lang.String,java.util.Set<java.lang.String>> getHints()
public boolean removeHint(java.lang.String name, java.lang.String tag)
public boolean removeHints(java.lang.String name, java.lang.String... tags)
public boolean removeHints(java.lang.String name, java.util.Collection<java.lang.String> tags)
public java.util.Set<java.lang.String> removeAllHints(java.lang.String name)
public void renameField(java.lang.String name, java.lang.String newName)
public void copyField(java.lang.String src, java.lang.String dest)
public com.lucidworks.apollo.aggregation.Aggregatable clear()
clear
in interface com.lucidworks.apollo.aggregation.Aggregatable
public java.util.Map<java.lang.String,java.util.List<PipelineField>> getFields()
public java.util.Set<java.lang.String> getAllFieldNames()
public java.util.Set<java.lang.String> getFieldNames()
getFilteredFieldNames(String...)
and passing
F_RESERVED_PREFIX
as argument.getFieldNames
in interface com.lucidworks.apollo.aggregation.Aggregatable
public java.util.Set<java.lang.String> getReservedFieldNames()
F_RESERVED_PREFIX
public java.util.Set<java.lang.String> getFilteredFieldNames(java.lang.String... excludePrefixes)
public boolean hasField(java.lang.String name)
name
- field name to check forpublic void setFields(java.util.Map<java.lang.String,java.util.List<PipelineField>> fields)
fields
- Map of fields to set in this document.public PipelineDocument addField(java.lang.String name, java.lang.Object value)
addField
in interface com.lucidworks.apollo.aggregation.Aggregatable
name
- field name (key)value
- value to addpublic com.lucidworks.apollo.aggregation.Aggregatable addFields(java.lang.String field, java.util.Collection<?> values)
addFields
in interface com.lucidworks.apollo.aggregation.Aggregatable
public PipelineDocument addField(java.lang.String name, java.lang.Object value, java.lang.String... meta)
public PipelineDocument addField(java.lang.String name, java.lang.Object value, java.util.List<Annotation> annotations)
public PipelineDocument addField(PipelineField fld)
public PipelineDocument addFieldIfDifferent(java.lang.String name, java.lang.Object value, java.lang.String... meta)
public PipelineDocument addFieldIfDifferent(java.lang.String name, java.lang.Object value, java.util.List<Annotation> annotations)
public PipelineDocument addFieldIfDifferent(PipelineField fld)
public PipelineDocument addFields(java.util.Collection<PipelineField> fields)
public PipelineDocument removeFields(java.lang.String name)
removeFields
in interface com.lucidworks.apollo.aggregation.Aggregatable
name
- name of field to removepublic PipelineDocument setField(java.lang.String name, java.lang.Object value)
setField
in interface com.lucidworks.apollo.aggregation.Aggregatable
name
- field name (key)value
- value to addpublic com.lucidworks.apollo.aggregation.Aggregatable setFields(java.lang.String field, java.util.Collection<?> values)
setFields
in interface com.lucidworks.apollo.aggregation.Aggregatable
public PipelineDocument setField(java.lang.String name, java.lang.Object value, java.lang.String... meta)
public PipelineDocument setField(java.lang.String name, java.lang.Object value, java.util.List<Annotation> annotations)
public java.util.List<PipelineField> getFields(java.lang.String name)
public java.util.List<java.lang.Object> getFieldValues(java.lang.String name)
getFieldValues
in interface com.lucidworks.apollo.aggregation.Aggregatable
public PipelineField getFirstField(java.lang.String name)
public java.lang.Object getFirstFieldValue(java.lang.String name)
getFirstFieldValue
in interface com.lucidworks.apollo.aggregation.Aggregatable
public PipelineField getLastField(java.lang.String name)
public java.util.List<PipelineField> getFlattenedFields()
public PipelineDocument setId(java.lang.String id)
public byte[] getContent()
public void setContent(byte[] data)
public java.util.List<Command> getCommands()
public void addCommands(java.util.List<Command> commands)
public PipelineDocument addCommand(java.lang.String cmd, java.util.Map<java.lang.String,java.lang.String> params)
public PipelineDocument addCommand(Command c)
public PipelineDocument removeCommands()
public static PipelineDocument newDelete(java.lang.String id, boolean commit)
public static PipelineDocument newDocument()
public static PipelineDocument newDocument(java.lang.String id)
public static PipelineDocument newDeleteByQuery(java.lang.String query, boolean commit)
public static PipelineDocument newCommit()
public static java.lang.String metadataKey(java.lang.String type, java.lang.String name, java.lang.String... additionalNames)
F_RESERVED_PREFIX
and join remaining parts with underscorestype
- The "type" of this key, e.g. "parser", "datasource", etcname
- The name of the keyadditionalNames
- Additional names to append to this keypublic java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object