|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface FieldQuery
Simple query interface that allows to search for representations based on fields and there values.
Currently it is only possible to set a single constraint per field. Therefore it is not possible to combine an range constraint with an language constraint. e.g. searching for all labels form a-f in a list of given languages. TODO: This shortcoming needs to be reevaluated. The intension was to ease the implementation and the usage of this interface. TODO: Implementation need to be able to throw UnsupportedConstraintExceptions for specific combinations of Constraints e.g. Regex or case insensitive ... TODO: Would be nice if an Implementation could also announce the list of supported constraints (e.g. via Capability levels ...)
| Field Summary | |
|---|---|
static String |
TYPE
The value used as result for Query.getQueryType() of this query
type. |
| Method Summary | ||
|---|---|---|
void |
addSelectedField(String field)
Adds Fields to be selected by this Query |
|
void |
addSelectedFields(Collection<String> fields)
Adds Fields to be selected by this Query |
|
FieldQuery |
clone()
Clones the FieldQuery |
|
|
copyTo(T copyTo)
Copies the state of this instance to the parsed one |
|
Constraint |
getConstraint(String field)
Getter for the Constraint of a field |
|
Set<Map.Entry<String,Constraint>> |
getConstraints()
Getter for the unmodifiable list of query elements for the given Path. |
|
Set<String> |
getSelectedFields()
Unmodifiable set with all the fields to be selected by this query |
|
boolean |
isConstrained(String field)
Checks if there is a constraint for the given field |
|
void |
removeAllConstraints()
Removes all constraints form the query |
|
void |
removeAllSelectedFields()
Removes all selected fields |
|
void |
removeConstraint(String field)
Removes the constraint for the parse field |
|
void |
removeSelectedField(String fields)
Removes Fields to be selected by this Query |
|
void |
removeSelectedFields(Collection<String> fields)
Removes Fields to be selected by this Query |
|
void |
setConstraint(String field,
Constraint constraint)
Sets/replaces the constraint for a field of the representation. |
|
| Methods inherited from interface org.apache.stanbol.entityhub.servicesapi.query.Query |
|---|
getLimit, getOffset, getQueryType, setLimit, setOffset |
| Methods inherited from interface java.lang.Iterable |
|---|
iterator |
| Field Detail |
|---|
static final String TYPE
Query.getQueryType() of this query
type.
| Method Detail |
|---|
void addSelectedField(String field)
fields - the fields to be selected by this queryvoid addSelectedFields(Collection<String> fields)
fields - the fields to be selected by this queryvoid removeSelectedField(String fields)
fields - the fields to be selected by this queryvoid removeSelectedFields(Collection<String> fields)
fields - the fields to be selected by this querySet<String> getSelectedFields()
void setConstraint(String field,
Constraint constraint)
null is parsed as constraint this method removes any existing
constraint for the field
field - the fieldconstraint - the Constraintvoid removeConstraint(String field)
field - boolean isConstrained(String field)
field - the field
Constraint getConstraint(String field)
field - the field
null if none is defined.Set<Map.Entry<String,Constraint>> getConstraints()
path - the path
void removeAllConstraints()
void removeAllSelectedFields()
<T extends FieldQuery> T copyTo(T copyTo)
T - the FieldQuery implementationcopyTo - the instance to copy the state
FieldQuery clone()
clone in interface Query
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||