public class FiqlSearchConditionBuilder extends SearchConditionBuilder
Examples:
SearchConditionBuilder b = SearchConditionBuilder.instance("fiql"); b.is("price").equalTo(123.5).query(); // gives "price==123.5" b.is("price").greaterThan(30).and().is("price").lessThan(50).query(); // gives "price=gt=30.0;price=lt=50.0"For very complex junctions nested "and"/"or" are allowed (breaking a bit fluency of interface) and looks like the following example:
SearchConditionBuilder b = SearchConditionBuilder.instance("fiql"); b.is("price").lessThan(100).and().or( b.is("title").equalTo("The lord*"), b.is("author").equalTo("R.R.Tolkien")).query(); // gives "price=lt=100.0;(title==The lord*,author==R.R.Tolkien)"
Modifier and Type | Class and Description |
---|---|
protected static class |
FiqlSearchConditionBuilder.Builder |
Modifier and Type | Field and Description |
---|---|
protected Map<String,String> |
properties |
DEFAULT_LANGUAGE, FIQL
Constructor and Description |
---|
FiqlSearchConditionBuilder() |
FiqlSearchConditionBuilder(Map<String,String> properties) |
Modifier and Type | Method and Description |
---|---|
CompleteCondition |
and(CompleteCondition c1,
CompleteCondition c2,
CompleteCondition... cn)
Conjunct multiple expressions
|
CompleteCondition |
and(List<CompleteCondition> conditions)
Conjunct multiple expressions
|
Property |
is(String property)
Get property of inspected entity type
|
protected FiqlSearchConditionBuilder.Builder |
newBuilderInstance() |
CompleteCondition |
or(CompleteCondition c1,
CompleteCondition c2,
CompleteCondition... cn)
Disjunct multiple expressions
|
CompleteCondition |
or(List<CompleteCondition> conditions)
Disjunct multiple expressions
|
String |
query()
Finalize condition construction and build search condition query.
|
instance, instance, instance, instance
protected FiqlSearchConditionBuilder.Builder newBuilderInstance()
public String query()
SearchConditionBuilder
query
in class SearchConditionBuilder
public Property is(String property)
PartialCondition
public CompleteCondition and(CompleteCondition c1, CompleteCondition c2, CompleteCondition... cn)
PartialCondition
public CompleteCondition and(List<CompleteCondition> conditions)
PartialCondition
public CompleteCondition or(List<CompleteCondition> conditions)
PartialCondition
public CompleteCondition or(CompleteCondition c1, CompleteCondition c2, CompleteCondition... cn)
PartialCondition
Apache CXF