Class FilterBuilder
ConnectorObject that satisfies
all of the selection criteria that were specified using this builder.- Since:
- 1.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic Filterand(Collection<Filter> subFilters) Creates a new "AND" filter using the provided list of sub-filters.static FilterCreates a new "AND" filter using the provided list of sub-filters.static FilterLogically "ANDs" together the two specified instances ofFilter.static FilterSelect only an inputConnectorObjectwith a value for the specifiedAttributethat contains as any substring the value of the specifiedAttribute.static FiltercontainsAllValues(Attribute attr) Select only an inputConnectorObjectwith a value for the specifiedAttributethat contains all the values from the specifiedAttribute.static FilterSelect only an inputConnectorObjectwith a value for the specifiedAttributethat contains as a final substring the value of the specifiedAttribute.static FilterSelect only an inputConnectorObjectwith a value for the specifiedAttributethat is lexically equal to the value of the specifiedAttribute.static FilterextendedMatch(String operator, Attribute attribute) Creates a newextended matchfilter using the provided operator and attribute assertion.static FiltergreaterThan(Attribute attr) Select only an inputConnectorObjectwith a value for the specifiedAttributethat is lexically greater than the value of the specifiedAttribute.static FilterSelect only an inputConnectorObjectwith a value for the specifiedAttributethat is lexically greater than or equal to the value of the specifiedAttribute.static FilterSelect only an inputConnectorObjectwith a value for the specifiedAttributethat is lexically less than the value of the specifiedAttribute.static FilterlessThanOrEqualTo(Attribute attr) Select only an inputConnectorObjectwith a value for the specifiedAttributethat is lexically less than or equal to the value of the specifiedAttribute.static FilterLogically negate the specifiedFilter.static Filteror(Collection<Filter> subFilters) Creates a new "OR" filter using the provided list of sub-filters.static FilterCreates a new "OR" filter using the provided list of sub-filters.static FilterLogically "OR" together the two specified instances ofFilter.static FilterCreates a newpresencefilter using the provided attribute name.static FilterstartsWith(Attribute attr) Select only an inputConnectorObjectwith a value for the specifiedAttributethat contains as an initial substring the value of the specifiedAttribute.
-
Method Details
-
endsWith
Select only an inputConnectorObjectwith a value for the specifiedAttributethat contains as a final substring the value of the specifiedAttribute.For example, if the specified
Attributewere{"hairColor": "d"},
this would match anyConnectorObjectwith a value such as
{"hairColor": "red"}or
{"hairColor": "blond"}
but would not match anyConnectorObjectthat contains only values such as
{"hairColor": "blonde"}or
{"hairColor": "auburn"}.
This also would not match anyConnectorObjectthat contains only{"hairColor": null}
or that lacks the attribute"hairColor".- Parameters:
attr-Attributecontaining exactly one value to test against each value of the correspondingConnectorObjectattribute.- Returns:
- an instance of
Filterwhoseaccept()method will returntrueif at least one value of the corresponding attribute of theConnectorObjectcontains as its last part the value of the specifiedAttribute; otherwisefalse.
-
startsWith
Select only an inputConnectorObjectwith a value for the specifiedAttributethat contains as an initial substring the value of the specifiedAttribute.For example, if the specified
Attributewere{"hairColor": "b"},
this would match anyConnectorObjectwith a value such as
{"hairColor": "brown"}or
{"hairColor": "blond"}
but would not match anyConnectorObjectthat contains only values such as
{"hairColor": "red"}or
{"hairColor": "auburn"}.
This also would not match anyConnectorObjectthat contains only{"hairColor": null}
or that lacks the attribute"hairColor".- Parameters:
attr-Attributecontaining exactly one value to test against each value of the correspondingConnectorObjectattribute.- Returns:
- an instance of
Filterwhoseaccept()method will returntrueif at least one value of the corresponding attribute of theConnectorObjectcontains as its first part the value of the specifiedAttribute; otherwisefalse.
-
contains
Select only an inputConnectorObjectwith a value for the specifiedAttributethat contains as any substring the value of the specifiedAttribute.For example, if the specified
Attributewere{"hairColor": "a"},
this would match anyConnectorObjectwith a value such as
{"hairColor": "auburn"}or
{"hairColor": "gray"}
but would not match anyConnectorObjectthat contains only
{"hairColor": "red"}or
{"hairColor": "grey"}.
This also would not match anyConnectorObjectthat contains only{"hairColor": null}
or that lacks the attribute"hairColor".- Parameters:
attr-Attributecontaining exactly one value to test against each value of the correspondingConnectorObjectattribute.- Returns:
- an instance of
Filterwhoseaccept()method will returntrueif at least one value of the corresponding attribute of theConnectorObjectcontains anywhere within it the value of the specifiedAttribute; otherwisefalse.
-
equalTo
Select only an inputConnectorObjectwith a value for the specifiedAttributethat is lexically equal to the value of the specifiedAttribute.NOTE: Is comparison case-sensitive?
For example, if the specified
Attributewere{"hairColor": "brown"},
this would match anyConnectorObjectwith a value such as
{"hairColor": "brown"}or
{"hairColor": "BROWN"}
but would not match anyConnectorObjectthat contains only
{"hairColor": "brownish-gray"}or
{"hairColor": "auburn"}.
This also would not match anyConnectorObjectthat contains only{"hairColor": null}
or that lacks the attribute"hairColor".NOTE: Lexical comparison of two string values compares the characters of each value, even if the string values could be interpreted as numeric. The values
"01"and"1"are unequal lexically, although they would be equivalent arithmetically.Two attributes with binary syntax are equal if and only if their constituent bytes match.
- Parameters:
attr-Attributecontaining exactly one value to test against each value of the correspondingConnectorObjectattribute.- Returns:
- an instance of
Filterwhoseaccept()method will returntrueif at least one value of the corresponding attribute of theConnectorObjectmatches lexically the value of the specifiedAttribute; otherwisefalse.
-
extendedMatch
Creates a newextended matchfilter using the provided operator and attribute assertion.- Parameters:
operator- The operator.attribute- The assertion value.- Since:
- 1.5
-
greaterThanOrEqualTo
Select only an inputConnectorObjectwith a value for the specifiedAttributethat is lexically greater than or equal to the value of the specifiedAttribute.NOTE: Is comparison case-sensitive?
For example, if the specified
Attributewere{"hairColor": "brown"},
this would match anyConnectorObjectwith a value such as
{"hairColor": "brown"}or
{"hairColor": "brownish-gray"}or
{"hairColor": "red"}
but would not match anyConnectorObjectthat contains only
{"hairColor": "black"}or
{"hairColor": "blond"}or
{"hairColor": "auburn"}.
This also would not match anyConnectorObjectthat contains only{"hairColor": null}
or that lacks the attribute"hairColor".NOTE: Lexical comparison of two string values compares the characters of each value, even if the string values could be interpreted as numeric.
When compared lexically,"99"is greater than"123".
When compared arithmetically,99is less than123.- Parameters:
attr-Attributecontaining exactly one value to test against each value of the correspondingConnectorObjectattribute.- Returns:
- an instance of
Filterwhoseaccept()method will returntrueif at least one value of the corresponding attribute of theConnectorObjectmatches or sorts alphabetically after the value of the specifiedAttribute; otherwisefalse.
-
lessThanOrEqualTo
Select only an inputConnectorObjectwith a value for the specifiedAttributethat is lexically less than or equal to the value of the specifiedAttribute.NOTE: Is comparison case-sensitive?
For example, if the specified
Attributewere{"hairColor": "brown"},
this would match anyConnectorObjectwith a value such as
{"hairColor": "brown"}or
{"hairColor": "black"}or
{"hairColor": "blond"}or
{"hairColor": "auburn"}
but would not match anyConnectorObjectthat contains only
{"hairColor": "brownish-gray"}or
{"hairColor": "red"}
This also would not match anyConnectorObjectthat contains only{"hairColor": null}
or that lacks the attribute"hairColor".NOTE: Lexical comparison of two string values compares the characters of each value, even if the string values could be interpreted as numeric.
When compared lexically,"99"is greater than"123".
When compared arithmetically,99is less than123.- Parameters:
attr-Attributecontaining exactly one value to test against each value of the correspondingConnectorObjectattribute.- Returns:
- an instance of
Filterwhoseaccept()method will returntrueif at least one value of the corresponding attribute of theConnectorObjectmatches or sorts alphabetically before the value of the specifiedAttribute; otherwisefalse.
-
lessThan
Select only an inputConnectorObjectwith a value for the specifiedAttributethat is lexically less than the value of the specifiedAttribute.NOTE: Is comparison case-sensitive?
For example, if the specified
Attributewere{"hairColor": "brown"},
this would match anyConnectorObjectwith a value such as
{"hairColor": "black"}or
{"hairColor": "blond"}or
{"hairColor": "auburn"}
but would not match anyConnectorObjectthat contains only
{"hairColor": "brown"}or
{"hairColor": "brownish-gray"}or
{"hairColor": "red"}
This also would not match anyConnectorObjectthat contains only{"hairColor": null}
or that lacks the attribute"hairColor".NOTE: Lexical comparison of two string values compares the characters of each value, even if the string values could be interpreted as numeric.
When compared lexically,"99"is greater than"123".
When compared arithmetically,99is less than123.- Parameters:
attr-Attributecontaining exactly one value to test against each value of the correspondingConnectorObjectattribute.- Returns:
- an instance of
Filterwhoseaccept()method will returntrueif at least one value of the corresponding attribute of theConnectorObjectsorts alphabetically before the value of the specifiedAttribute; otherwisefalse.
-
greaterThan
Select only an inputConnectorObjectwith a value for the specifiedAttributethat is lexically greater than the value of the specifiedAttribute.NOTE: Is comparison case-sensitive?
For example, if the specified
Attributewere{"hairColor": "brown"},
this would match anyConnectorObjectwith a value such as
{"hairColor": "brownish-gray"}or
{"hairColor": "red"}
but would not match anyConnectorObjectthat contains only
{"hairColor": "brown"}or
{"hairColor": "black"}or
{"hairColor": "blond"}or
{"hairColor": "auburn"}.
This also would not match anyConnectorObjectthat contains only{"hairColor": null}
or that lacks the attribute"hairColor".NOTE: Lexical comparison of two string values compares the characters of each value, even if the string values could be interpreted as numeric.
When compared lexically,"99"is greater than"123".
When compared arithmetically,99is less than123.- Parameters:
attr-Attributecontaining exactly one value to test against each value of the correspondingConnectorObjectattribute.- Returns:
- an instance of
Filterwhoseaccept()method will returntrueif at least one value of the corresponding attribute of theConnectorObjectsorts alphabetically after the value of the specifiedAttribute; otherwisefalse.
-
and
Logically "ANDs" together the two specified instances ofFilter. The resulting conjunctFilteris true if and only if both of the specified filters are true.- Parameters:
leftHandSide- left-hand-side filter.rightHandSide- right-hand-side filter.- Returns:
- the result of
(leftHandSide && rightHandSide)
-
and
Creates a new "AND" filter using the provided list of sub-filters.Creating a new "AND" filter with a
nullor empty list of sub-filters is equivalent to calling "alwaysTrue".- Parameters:
subFilters- The list of sub-filters, may be empty ornull.- Returns:
- The newly created "AND" filter.
-
and
Creates a new "AND" filter using the provided list of sub-filters.Creating a new "AND" filter with a
nullor empty list of sub-filters is equivalent to calling "alwaysTrue".- Parameters:
subFilters- The list of sub-filters, may be empty ornull.- Returns:
- The newly created "AND" filter.
-
or
Logically "OR" together the two specified instances ofFilter. The resulting disjunctFilteris true if and only if at least one of the specified filters is true.- Parameters:
leftHandSide- left-hand-side filter.rightHandSide- right-hand-side filter.- Returns:
- the result of
(leftHandSide || rightHandSide)
-
or
Creates a new "OR" filter using the provided list of sub-filters.Creating a new "OR" filter with a
nullor empty list of sub-filters is equivalent to "alwaysTrue".- Parameters:
subFilters- The list of sub-filters, may be empty ornull.- Returns:
- The newly created
orfilter.
-
or
Creates a new "OR" filter using the provided list of sub-filters.Creating a new "OR" filter with a
nullor empty list of sub-filters is equivalent to "alwaysTrue".- Parameters:
subFilters- The list of sub-filters, may be empty ornull.- Returns:
- The newly created
orfilter.
-
not
Logically negate the specifiedFilter. The resultingFilteris true if and only if the specified filter is false.- Parameters:
filter- theFilterto negate.- Returns:
- the result of
(!filter).
-
present
Creates a newpresencefilter using the provided attribute name.- Parameters:
attributeName- The name of field within theConnectorObjectwhich must be present.- Returns:
- The newly created
presencefilter. - Since:
- 1.5
-
containsAllValues
Select only an inputConnectorObjectwith a value for the specifiedAttributethat contains all the values from the specifiedAttribute.For example, if the specified
Attributewere{"hairColor": "brown", "red"},
this would match anyConnectorObjectwith values such as{"hairColor": "black", "brown", "red"}{"hairColor": "blond", "brown", "red"}{"hairColor": "auburn", "brown", "red"}
ConnectorObjectthat contains only{"hairColor": "brown"}{"hairColor": "brownish-gray"}{"hairColor": "red"}
ConnectorObjectthat contains only{"hairColor": null}
or that lacks the attribute"hairColor".NOTE: Lexical comparison of two string values compares the characters of each value, even if the string values could be interpreted as numeric.
- Parameters:
attr-Attributecontaining exactly one value to test against each value of the correspondingConnectorObjectattribute.- Returns:
- an instance of
Filterwhoseaccept()method will returntrueif at least one value of the corresponding attribute of theConnectorObjectsorts alphabetically before the value of the specifiedAttribute; otherwisefalse.
-