Skip navigation links


org.identityconnectors.framework.common.objects.filter
Class FilterBuilder

java.lang.Object
  extended by org.identityconnectors.framework.common.objects.filter.FilterBuilder


public final class FilterBuilder
extends java.lang.Object

FilterBuilder creates a filter that will match any ConnectorObject or EmbeddedObject that satisfies all of the selection criteria that were specified using this builder.

Since:
1.0
Version:
$Revision: /main/2 $
Author:
Will Droste

Constructor Summary
FilterBuilder()
           

 

Method Summary
static Filter and(Filter leftHandSide, Filter rightHandSide)
          Logically "ANDs" together the two specified instances of Filter.
static Filter contains(Attribute attr)
          Select only an input ConnectorObject or EmbeddedObject with a value for the specified Attribute that contains as any substring the value of the specified Attribute.
static Filter containsAllValues(Attribute attr)
          Select only an input ConnectorObject with a value for the or EmbeddedObject specified Attribute that contains all the values from the specified Attribute.
static Filter containsIgnoreCase(Attribute attr)
          Select only an input ConnectorObject or EmbeddedObject with a value for the specified Attribute that contains as any substring (ignoring case) the value of the specified Attribute.
static Filter embeddedObject(java.lang.String attributeName, Filter filter)
          Applies the specified instance of Filter to each of the EmbeddedObjects that constitute the value of the specified attribute name of a ConnectorObject or EmbeddedObject.
static Filter endsWith(Attribute attr)
          Select only an input ConnectorObject or EmbeddedObject with a value for the specified Attribute that contains as a final substring the value of the specified Attribute.
static Filter endsWithIgnoreCase(Attribute attr)
          Select only an input ConnectorObject or EmbeddedObject with a value for the specified Attribute that contains as a final substring (ignoring case) the value of the specified Attribute.
static Filter equalTo(Attribute attr)
          Select only an input ConnectorObject or EmbeddedObject with a value for the specified Attribute that is lexically equal to the value of the specified Attribute.
static Filter equalToIgnoreCase(Attribute attr)
          Select only an input ConnectorObject or EmbeddedObject with a value for the specified Attribute that is lexically equal to the value of the specified Attribute.
static Filter greaterThan(Attribute attr)
          Select only an input ConnectorObject or EmbeddedObject with a value for the specified Attribute that is lexically greater than the value of the specified Attribute.
static Filter greaterThanOrEqualTo(Attribute attr)
          Select only an input ConnectorObject or EmbeddedObject with a value for the specified Attribute that is lexically greater than or equal to the value of the specified Attribute.
static Filter lessThan(Attribute attr)
          Select only an input ConnectorObject or EmbeddedObject with a value for the specified Attribute that is lexically less than the value of the specified Attribute.
static Filter lessThanOrEqualTo(Attribute attr)
          Select only an input ConnectorObject or EmbeddedObject with a value for the specified Attribute that is lexically less than or equal to the value of the specified Attribute.
static Filter not(Filter filter)
          Logically negate the specified Filter.
static Filter or(Filter leftHandSide, Filter rightHandSide)
          Logically "OR" together the two specified instances of Filter.
static Filter startsWith(Attribute attr)
          Select only an input ConnectorObject or EmbeddedObject with a value for the specified Attribute that contains as an initial substring the value of the specified Attribute.
static Filter startsWithIgnoreCase(Attribute attr)
          Select only an input ConnectorObject or EmbeddedObject with a value for the specified Attribute that contains as an initial substring (ignoring case) the value of the specified Attribute.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

FilterBuilder

public FilterBuilder()

Method Detail

endsWith

public static Filter endsWith(Attribute attr)
Select only an input ConnectorObject or EmbeddedObject with a value for the specified Attribute that contains as a final substring the value of the specified Attribute.

For example, if the specified Attribute were {"hairColor": "d"},
this would match any ConnectorObject with a value such as
     {"hairColor": "red"} or
     {"hairColor": "blond"}
but would not match any ConnectorObject that contains only values such as
     {"hairColor": "blonde"} or
     {"hairColor": "auburn"}.
This also would not match any ConnectorObject that contains only {"hairColor": null}
or that lacks the attribute "hairColor".

Parameters:
attr - Attribute containing exactly one value to test against each value of the corresponding ConnectorObject or EmbeddedObject attribute.
Returns:
an instance of Filter whose accept() method will return true if at least one value of the corresponding attribute of the ConnectorObject or EmbeddedObjectcontains as its last part the value of the specified Attribute; otherwise false.

endsWithIgnoreCase

public static Filter endsWithIgnoreCase(Attribute attr)
Select only an input ConnectorObject or EmbeddedObject with a value for the specified Attribute that contains as a final substring (ignoring case) the value of the specified Attribute.

For example, if the specified Attribute were {"hairColor": "D"},
this would match any ConnectorObject with a value such as
     {"hairColor": "red"} or
     {"hairColor": "blond"}
but would not match any ConnectorObject that contains only values such as
     {"hairColor": "blonde"} or
     {"hairColor": "auburn"}.
This also would not match any ConnectorObject that contains only {"hairColor": null}
or that lacks the attribute "hairColor".

Parameters:
attr - Attribute containing exactly one value to test against each value of the corresponding ConnectorObject or EmbeddedObject attribute.
Returns:
an instance of Filter whose accept() method will return true if at least one value of the corresponding attribute of the ConnectorObject or EmbeddedObjectcontains as its last part the value of the specified Attribute; otherwise false.

startsWith

public static Filter startsWith(Attribute attr)
Select only an input ConnectorObject or EmbeddedObject with a value for the specified Attribute that contains as an initial substring the value of the specified Attribute.

For example, if the specified Attribute were {"hairColor": "b"},
this would match any ConnectorObject with a value such as
     {"hairColor": "brown"} or
     {"hairColor": "blond"}
but would not match any ConnectorObject that contains only values such as
     {"hairColor": "red"} or
     {"hairColor": "auburn"}.
This also would not match any ConnectorObject that contains only {"hairColor": null}
or that lacks the attribute "hairColor".

Parameters:
attr - Attribute containing exactly one value to test against each value of the corresponding ConnectorObject or EmbeddedObject attribute.
Returns:
an instance of Filter whose accept() method will return true if at least one value of the corresponding attribute of the ConnectorObject or EmbeddedObjectcontains as its first part the value of the specified Attribute; otherwise false.

startsWithIgnoreCase

public static Filter startsWithIgnoreCase(Attribute attr)
Select only an input ConnectorObject or EmbeddedObject with a value for the specified Attribute that contains as an initial substring (ignoring case) the value of the specified Attribute.

For example, if the specified Attribute were {"hairColor": "B"},
this would match any ConnectorObject with a value such as
     {"hairColor": "brown"} or
     {"hairColor": "blond"}
but would not match any ConnectorObject that contains only values such as
     {"hairColor": "red"} or
     {"hairColor": "auburn"}.
This also would not match any ConnectorObject that contains only {"hairColor": null}
or that lacks the attribute "hairColor".

Parameters:
attr - Attribute containing exactly one value to test against each value of the corresponding ConnectorObject or EmbeddedObject attribute.
Returns:
an instance of Filter whose accept() method will return true if at least one value of the corresponding attribute of the ConnectorObject or EmbeddedObjectcontains as its first part the value of the specified Attribute; otherwise false.

contains

public static Filter contains(Attribute attr)
Select only an input ConnectorObject or EmbeddedObject with a value for the specified Attribute that contains as any substring the value of the specified Attribute.

For example, if the specified Attribute were {"hairColor": "a"},
this would match any ConnectorObject with a value such as
    {"hairColor": "auburn"} or
    {"hairColor": "gray"}
but would not match any ConnectorObject that contains only
    {"hairColor": "red"} or
    {"hairColor": "grey"}.
This also would not match any ConnectorObject that contains only {"hairColor": null}
or that lacks the attribute "hairColor".

Parameters:
attr - Attribute containing exactly one value to test against each value of the corresponding ConnectorObject or EmbeddedObject attribute.
Returns:
an instance of Filter whose accept() method will return true if at least one value of the corresponding attribute of the ConnectorObject or EmbeddedObjectcontains anywhere within it the value of the specified Attribute; otherwise false.

containsIgnoreCase

public static Filter containsIgnoreCase(Attribute attr)
Select only an input ConnectorObject or EmbeddedObject with a value for the specified Attribute that contains as any substring (ignoring case) the value of the specified Attribute.

For example, if the specified Attribute were {"hairColor": "A"},
this would match any ConnectorObject with a value such as
    {"hairColor": "auburn"} or
    {"hairColor": "gray"}
but would not match any ConnectorObject that contains only
    {"hairColor": "red"} or
    {"hairColor": "grey"}.
This also would not match any ConnectorObject that contains only {"hairColor": null}
or that lacks the attribute "hairColor".

Parameters:
attr - Attribute containing exactly one value to test against each value of the corresponding ConnectorObject or EmbeddedObject attribute.
Returns:
an instance of Filter whose accept() method will return true if at least one value of the corresponding attribute of the ConnectorObject or EmbeddedObjectcontains anywhere within it the value of the specified Attribute; otherwise false.

equalTo

public static Filter equalTo(Attribute attr)
Select only an input ConnectorObject or EmbeddedObject with a value for the specified Attribute that is lexically equal to the value of the specified Attribute.

NOTE: The comparison is case-sensitive

For example, if the specified Attribute were {"hairColor": "brown"},
this would match any ConnectorObject with a value such as
    {"hairColor": "brown"} or
    {"hairColor": "BROWN"}
but would not match any ConnectorObject that contains only
    {"hairColor": "brownish-gray"} or
    {"hairColor": "auburn"}.
This also would not match any ConnectorObject that 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 - Attribute containing exactly one value to test against each value of the corresponding ConnectorObject or EmbeddedObject attribute.
Returns:
an instance of Filter whose accept() method will return true if at least one value of the corresponding attribute of the ConnectorObject or EmbeddedObject matches lexically the value of the specified Attribute; otherwise false.

equalToIgnoreCase

public static Filter equalToIgnoreCase(Attribute attr)
Select only an input ConnectorObject or EmbeddedObject with a value for the specified Attribute that is lexically equal to the value of the specified Attribute.

NOTE: The comparison is NOT case-sensitive

For example, if the specified Attribute were {"hairColor": "brown"},
this would match any ConnectorObject with a value such as
    {"hairColor": "brown"} or
    {"hairColor": "BROWN"}
but would not match any ConnectorObject that contains only
    {"hairColor": "brownish-gray"} or
    {"hairColor": "auburn"}.
This also would not match any ConnectorObject that 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 - Attribute containing exactly one value to test against each value of the corresponding ConnectorObject or EmbeddedObject attribute.
Returns:
an instance of Filter whose accept() method will return true if at least one value of the corresponding attribute of the ConnectorObject or EmbeddedObject matches lexically the value of the specified Attribute; otherwise false.

greaterThanOrEqualTo

public static Filter greaterThanOrEqualTo(Attribute attr)
Select only an input ConnectorObject or EmbeddedObject with a value for the specified Attribute that is lexically greater than or equal to the value of the specified Attribute.

NOTE: Is comparison case-sensitive?

For example, if the specified Attribute were {"hairColor": "brown"},
this would match any ConnectorObject with a value such as
    {"hairColor": "brown"} or
    {"hairColor": "brownish-gray"} or
    {"hairColor": "red"}
but would not match any ConnectorObject that contains only
    {"hairColor": "black"} or
    {"hairColor": "blond"} or
    {"hairColor": "auburn"}.
This also would not match any ConnectorObject that 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, 99 is less than 123.

Parameters:
attr - Attribute containing exactly one value to test against each value of the corresponding ConnectorObject or EmbeddedObject attribute.
Returns:
an instance of Filter whose accept() method will return true if at least one value of the corresponding attribute of the ConnectorObject or EmbeddedObject matches or sorts alphabetically after the value of the specified Attribute; otherwise false.

lessThanOrEqualTo

public static Filter lessThanOrEqualTo(Attribute attr)
Select only an input ConnectorObject or EmbeddedObject with a value for the specified Attribute that is lexically less than or equal to the value of the specified Attribute.

NOTE: Is comparison case-sensitive?

For example, if the specified Attribute were {"hairColor": "brown"},
this would match any ConnectorObject with a value such as
    {"hairColor": "brown"} or
    {"hairColor": "black"} or
    {"hairColor": "blond"} or
    {"hairColor": "auburn"}
but would not match any ConnectorObject that contains only
    {"hairColor": "brownish-gray"} or
    {"hairColor": "red"}
This also would not match any ConnectorObject that 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, 99 is less than 123.

Parameters:
attr - Attribute containing exactly one value to test against each value of the corresponding ConnectorObject or EmbeddedObject attribute.
Returns:
an instance of Filter whose accept() method will return true if at least one value of the corresponding attribute of the ConnectorObject or EmbeddedObject matches or sorts alphabetically before the value of the specified Attribute; otherwise false.

lessThan

public static Filter lessThan(Attribute attr)
Select only an input ConnectorObject or EmbeddedObject with a value for the specified Attribute that is lexically less than the value of the specified Attribute.

NOTE: Is comparison case-sensitive?

For example, if the specified Attribute were {"hairColor": "brown"},
this would match any ConnectorObject with a value such as
    {"hairColor": "black"} or
    {"hairColor": "blond"} or
    {"hairColor": "auburn"}
but would not match any ConnectorObject that contains only
    {"hairColor": "brown"} or
    {"hairColor": "brownish-gray"} or
    {"hairColor": "red"}
This also would not match any ConnectorObject that 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, 99 is less than 123.

Parameters:
attr - Attribute containing exactly one value to test against each value of the corresponding ConnectorObject or EmbeddedObject attribute.
Returns:
an instance of Filter whose accept() method will return true if at least one value of the corresponding attribute of the ConnectorObject or EmbeddedObject sorts alphabetically before the value of the specified Attribute; otherwise false.

greaterThan

public static Filter greaterThan(Attribute attr)
Select only an input ConnectorObject or EmbeddedObject with a value for the specified Attribute that is lexically greater than the value of the specified Attribute.

NOTE: Is comparison case-sensitive?

For example, if the specified Attribute were {"hairColor": "brown"},
this would match any ConnectorObject with a value such as
    {"hairColor": "brownish-gray"} or
    {"hairColor": "red"}
but would not match any ConnectorObject that contains only
    {"hairColor": "brown"} or
    {"hairColor": "black"} or
    {"hairColor": "blond"} or
    {"hairColor": "auburn"}.
This also would not match any ConnectorObject that 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, 99 is less than 123.

Parameters:
attr - Attribute containing exactly one value to test against each value of the corresponding ConnectorObject or EmbeddedObject attribute.
Returns:
an instance of Filter whose accept() method will return true if at least one value of the corresponding attribute of the ConnectorObject or EmbeddedObject sorts alphabetically after the value of the specified Attribute; otherwise false.

and

public static Filter and(Filter leftHandSide,
                         Filter rightHandSide)
Logically "ANDs" together the two specified instances of Filter. The resulting conjunct Filter is 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)

or

public static Filter or(Filter leftHandSide,
                        Filter rightHandSide)
Logically "OR" together the two specified instances of Filter. The resulting disjunct Filter is 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)

not

public static Filter not(Filter filter)
Logically negate the specified Filter. The resulting Filter is true if and only if the specified filter is false.
Parameters:
filter - the Filter to negate.
Returns:
the result of (!filter).

embeddedObject

public static Filter embeddedObject(java.lang.String attributeName,
                                    Filter filter)
Applies the specified instance of Filter to each of the EmbeddedObjects that constitute the value of the specified attribute name of a ConnectorObject or EmbeddedObject.
Parameters:
attributeName - the name of the attribute holding EmbeddedObjects.
filter - the filter to apply to the EmbeddedObjects that are values of the attributeName attribute.
Returns:
an instance of Filter whose accept() method will return true if and only if the Filter specified in the filter parameter is true for at least one of the EmbeddedObjects that are values of the attributeName attribute.
Since:
1.2

containsAllValues

public static Filter containsAllValues(Attribute attr)
Select only an input ConnectorObject with a value for the or EmbeddedObject specified Attribute that contains all the values from the specified Attribute.

For example, if the specified Attribute were {"hairColor": "brown", "red"},
this would match any ConnectorObject with values such as

but would not match any ConnectorObject that contains only This also would not match any ConnectorObject that 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 - Attribute containing exactly one value to test against each value of the corresponding ConnectorObject or EmbeddedObject attribute.
Returns:
an instance of Filter whose accept() method will return true if at least one value of the corresponding attribute of the ConnectorObject or EmbeddedObject sorts alphabetically before the value of the specified Attribute; otherwise false.

Skip navigation links


Copyright © 2013, Oracle and/or its affiliates. All rights reserved.