Class FilterBuilder
- java.lang.Object
-
- org.identityconnectors.framework.common.objects.filter.FilterBuilder
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Filterand(Collection<Filter> subFilters)Creates a new "AND" filter using the provided list of sub-filters.static Filterand(Filter... subFilters)Creates a new "AND" filter using the provided list of sub-filters.static Filterand(Filter leftHandSide, Filter rightHandSide)Logically "ANDs" together the two specified instances ofFilter.static Filtercontains(Attribute attr)Select 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 FilterendsWith(Attribute attr)Select only an inputConnectorObjectwith a value for the specifiedAttributethat contains as a final substring the value of the specifiedAttribute.static FilterequalsIgnoreCase(Attribute attr)Select only an inputConnectorObjectwith a value for the specifiedAttributethat is equal to, not considering the case the value of the specifiedAttribute.static FilterequalTo(Attribute attr)Select only an inputConnectorObjectwith a value for the specifiedAttributethat is lexically equal to the value of the specifiedAttribute.static FiltergreaterThan(Attribute attr)Select only an inputConnectorObjectwith a value for the specifiedAttributethat is lexically greater than the value of the specifiedAttribute.static FiltergreaterThanOrEqualTo(Attribute attr)Select only an inputConnectorObjectwith a value for the specifiedAttributethat is lexically greater than or equal to the value of the specifiedAttribute.static FilterlessThan(Attribute attr)Select 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 Filternot(Filter filter)Logically negate the specifiedFilter.static Filteror(Collection<Filter> subFilters)Creates a new "OR" filter using the provided list of sub-filters.static Filteror(Filter... subFilters)Creates a new "OR" filter using the provided list of sub-filters.static Filteror(Filter leftHandSide, Filter rightHandSide)Logically "OR" together the two specified instances ofFilter.static FilterstartsWith(Attribute attr)Select only an inputConnectorObjectwith a value for the specifiedAttributethat contains as an initial substring the value of the specifiedAttribute.
-
-
-
Method Detail
-
endsWith
public static Filter endsWith(Attribute attr)
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
public static Filter startsWith(Attribute attr)
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
public static Filter contains(Attribute attr)
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.
-
equalsIgnoreCase
public static Filter equalsIgnoreCase(Attribute attr)
Select only an inputConnectorObjectwith a value for the specifiedAttributethat is equal to, not considering the case the value of the specifiedAttribute.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 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 theConnectorObjectis equal ignore case the value of the specifiedAttribute; otherwisefalse.
-
equalTo
public static Filter equalTo(Attribute attr)
Select only an inputConnectorObjectwith a value for the specifiedAttributethat is lexically equal to the value of the specifiedAttribute.For example, if the specified
Attributewere{"hairColor": "brown"},
this would match anyConnectorObjectwith a value such as
{"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.
-
greaterThanOrEqualTo
public static Filter greaterThanOrEqualTo(Attribute attr)
Select only an inputConnectorObjectwith a value for the specifiedAttributethat is lexically greater than or equal to the value of the specifiedAttribute.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
public static Filter lessThanOrEqualTo(Attribute attr)
Select only an inputConnectorObjectwith a value for the specifiedAttributethat is lexically less than or equal to the value of the specifiedAttribute.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
public static Filter lessThan(Attribute attr)
Select only an inputConnectorObjectwith a value for the specifiedAttributethat is lexically less than the value of the specifiedAttribute.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
public static Filter greaterThan(Attribute attr)
Select only an inputConnectorObjectwith a value for the specifiedAttributethat is lexically greater than the value of the specifiedAttribute.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
public static Filter and(Filter leftHandSide, Filter rightHandSide)
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
public static Filter and(Collection<Filter> subFilters)
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
public static Filter and(Filter... subFilters)
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
public static Filter or(Filter leftHandSide, Filter rightHandSide)
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
public static Filter or(Collection<Filter> subFilters)
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
public static Filter or(Filter... subFilters)
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
public static Filter not(Filter filter)
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).
-
containsAllValues
public static Filter containsAllValues(Attribute attr)
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.
-
-