public interface FieldQuery extends Query, Iterable<Map.Entry<String,Constraint>>, Cloneable
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 ...)
| Modifier and Type | Field and Description |
|---|---|
static String |
TYPE
The value used as result for
Query.getQueryType() of this query
type. |
| Modifier and Type | Method and Description |
|---|---|
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
|
<T extends 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.
|
static final String TYPE
Query.getQueryType() of this query
type.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 fieldfield - the fieldconstraint - the Constraintvoid removeConstraint(String field)
field - boolean isConstrained(String field)
field - the fieldConstraint getConstraint(String field)
field - the fieldnull if none is defined.Set<Map.Entry<String,Constraint>> getConstraints()
path - the pathvoid removeAllConstraints()
void removeAllSelectedFields()
<T extends FieldQuery> T copyTo(T copyTo)
T - the FieldQuery implementationcopyTo - the instance to copy the stateFieldQuery clone()
Copyright © 2010-2014 The Apache Software Foundation. All Rights Reserved.