Revision: 1591
http://sourceforge.net/p/ldap-sdk/code/1591
Author: dirmgr
Date: 2023-03-08 16:35:16 +0000 (Wed, 08 Mar 2023)
Log Message:
-----------
Add shorter method names for constructing filters
Added convenience methods with shorter names for constructing search
filters from their individual components. For example, instead of
calling Filter.createANDFilter(components), you can now use
Filter.and(components), and instead of
Filter.createEqualityFilter(attributeName, assertionValue), you can
now use Filter.equals(attributeName, assertionValue). The existing
methods with longer names will remain available for backward
compatibility.
Modified Paths:
--------------
trunk/docs/release-notes.html
trunk/src/com/unboundid/ldap/sdk/Filter.java
trunk/tests/unit/src/com/unboundid/ldap/sdk/FilterTestCase.java
Modified: trunk/docs/release-notes.html
===================================================================
--- trunk/docs/release-notes.html 2023-03-02 21:07:49 UTC (rev 1590)
+++ trunk/docs/release-notes.html 2023-03-08 16:35:16 UTC (rev 1591)
@@ -28,6 +28,16 @@
</li>
<li>
+ Added convenience methods with shorter names for constructing search filters
+ from their individual components. For example, instead of calling
+ Filter.createANDFilter(components), you can now use Filter.and(components), and
+ instead of Filter.createEqualityFilter(attributeName, assertionValue), you can
+ now use Filter.equals(attributeName, assertionValue). The existing methods with
+ longer names will remain available for backward compatibility.
+ <br><br>
+ </li>
+
+ <li>
Added support for encrypted PKCS #8 private keys. Private keys can now be
formatted in encrypted PEM when provided with an encryption password and a set
of encryption properties, and the PKCS #8 PEM file reader can read encrypted
Modified: trunk/src/com/unboundid/ldap/sdk/Filter.java
===================================================================
--- trunk/src/com/unboundid/ldap/sdk/Filter.java 2023-03-02 21:07:49 UTC (rev 1590)
+++ trunk/src/com/unboundid/ldap/sdk/Filter.java 2023-03-08 16:35:16 UTC (rev 1591)
@@ -441,6 +441,10 @@
/**
* Creates a new AND search filter with the provided components.
+ * <BR><BR>
+ * This method does exactly the same thing as
+ * {@link #createANDFilter(Filter...)}, but with a shorter method name for
+ * convenience.
*
* @param andComponents The set of filter components to include in the AND
* filter. It must not be {@code null}.
@@ -448,6 +452,42 @@
* @return The created AND search filter.
*/
@NotNull()
+ public static Filter and(@NotNull final Filter... andComponents)
+ {
+ return createANDFilter(andComponents);
+ }
+
+
+
+ /**
+ * Creates a new AND search filter with the provided components.
+ * <BR><BR>
+ * This method does exactly the same thing as
+ * {@link #createANDFilter(Collection)}, but with a shorter method name for
+ * convenience.
+ *
+ * @param andComponents The set of filter components to include in the AND
+ * filter. It must not be {@code null}.
+ *
+ * @return The created AND search filter.
+ */
+ @NotNull()
+ public static Filter and(@NotNull final Collection<Filter> andComponents)
+ {
+ return createANDFilter(andComponents);
+ }
+
+
+
+ /**
+ * Creates a new AND search filter with the provided components.
+ *
+ * @param andComponents The set of filter components to include in the AND
+ * filter. It must not be {@code null}.
+ *
+ * @return The created AND search filter.
+ */
+ @NotNull()
public static Filter createANDFilter(@NotNull final Filter... andComponents)
{
Validator.ensureNotNull(andComponents);
@@ -502,6 +542,10 @@
/**
* Creates a new OR search filter with the provided components.
+ * <BR><BR>
+ * This method does exactly the same thing as
+ * {@link #createORFilter(Filter...)}, but with a shorter method name for
+ * convenience.
*
* @param orComponents The set of filter components to include in the OR
* filter. It must not be {@code null}.
@@ -509,6 +553,42 @@
* @return The created OR search filter.
*/
@NotNull()
+ public static Filter or(@NotNull final Filter... orComponents)
+ {
+ return createORFilter(orComponents);
+ }
+
+
+
+ /**
+ * Creates a new OR search filter with the provided components.
+ * <BR><BR>
+ * This method does exactly the same thing as
+ * {@link #createORFilter(Collection)}, but with a shorter method name for
+ * convenience.
+ *
+ * @param orComponents The set of filter components to include in the OR
+ * filter. It must not be {@code null}.
+ *
+ * @return The created OR search filter.
+ */
+ @NotNull()
+ public static Filter or(@NotNull final Collection<Filter> orComponents)
+ {
+ return createORFilter(orComponents);
+ }
+
+
+
+ /**
+ * Creates a new OR search filter with the provided components.
+ *
+ * @param orComponents The set of filter components to include in the OR
+ * filter. It must not be {@code null}.
+ *
+ * @return The created OR search filter.
+ */
+ @NotNull()
public static Filter createORFilter(@NotNull final Filter... orComponents)
{
Validator.ensureNotNull(orComponents);
@@ -562,6 +642,10 @@
/**
* Creates a new NOT search filter with the provided component.
+ * <BR><BR>
+ * This method does exactly the same thing as
+ * {@link #createNOTFilter(Filter)}, but with a shorter method name for
+ * convenience.
*
* @param notComponent The filter component to include in this NOT filter.
* It must not be {@code null}.
@@ -569,6 +653,22 @@
* @return The created NOT search filter.
*/
@NotNull()
+ public static Filter not(@NotNull final Filter notComponent)
+ {
+ return createNOTFilter(notComponent);
+ }
+
+
+
+ /**
+ * Creates a new NOT search filter with the provided component.
+ *
+ * @param notComponent The filter component to include in this NOT filter.
+ * It must not be {@code null}.
+ *
+ * @return The created NOT search filter.
+ */
+ @NotNull()
public static Filter createNOTFilter(@NotNull final Filter notComponent)
{
Validator.ensureNotNull(notComponent);
@@ -581,6 +681,10 @@
/**
* Creates a new equality search filter with the provided information.
+ * <BR><BR>
+ * This method does exactly the same thing as
+ * {@link #createEqualityFilter(String,String)}, but with a shorter method
+ * name for convenience.
*
* @param attributeName The attribute name for this equality filter. It
* must not be {@code null}.
@@ -590,6 +694,48 @@
* @return The created equality search filter.
*/
@NotNull()
+ public static Filter equals(@NotNull final String attributeName,
+ @NotNull final String assertionValue)
+ {
+ return createEqualityFilter(attributeName, assertionValue);
+ }
+
+
+
+ /**
+ * Creates a new equality search filter with the provided information.
+ * <BR><BR>
+ * This method does exactly the same thing as
+ * {@link #createEqualityFilter(String,byte[])}, but with a shorter method
+ * name for convenience.
+ *
+ * @param attributeName The attribute name for this equality filter. It
+ * must not be {@code null}.
+ * @param assertionValue The assertion value for this equality filter. It
+ * must not be {@code null}.
+ *
+ * @return The created equality search filter.
+ */
+ @NotNull()
+ public static Filter equals(@NotNull final String attributeName,
+ @NotNull final byte[] assertionValue)
+ {
+ return createEqualityFilter(attributeName, assertionValue);
+ }
+
+
+
+ /**
+ * Creates a new equality search filter with the provided information.
+ *
+ * @param attributeName The attribute name for this equality filter. It
+ * must not be {@code null}.
+ * @param assertionValue The assertion value for this equality filter. It
+ * must not be {@code null}.
+ *
+ * @return The created equality search filter.
+ */
+ @NotNull()
public static Filter createEqualityFilter(@NotNull final String attributeName,
@NotNull final String assertionValue)
{
@@ -652,6 +798,10 @@
* Creates a new substring search filter with the provided information. At
* least one of the subInitial, subAny, and subFinal components must not be
* {@code null}.
+ * <BR><BR>
+ * This method does exactly the same thing as
+ * {@link #createSubstringFilter(String,String,String[],String)}, but with a
+ * shorter method name for convenience.
*
* @param attributeName The attribute name for this substring filter. It
* must not be {@code null}.
@@ -663,6 +813,60 @@
* @return The created substring search filter.
*/
@NotNull()
+ public static Filter substring(@NotNull final String attributeName,
+ @Nullable final String subInitial,
+ @Nullable final String[] subAny,
+ @Nullable final String subFinal)
+ {
+ return createSubstringFilter(attributeName, subInitial, subAny, subFinal);
+ }
+
+
+
+ /**
+ * Creates a new substring search filter with the provided information. At
+ * least one of the subInitial, subAny, and subFinal components must not be
+ * {@code null}.
+ * <BR><BR>
+ * This method does exactly the same thing as
+ * {@link #createSubstringFilter(String,byte[],byte[][],byte[])}, but with a
+ * shorter method name for convenience.
+ *
+ * @param attributeName The attribute name for this substring filter. It
+ * must not be {@code null}.
+ * @param subInitial The subInitial component for this substring filter.
+ * @param subAny The set of subAny components for this substring
+ * filter.
+ * @param subFinal The subFinal component for this substring filter.
+ *
+ * @return The created substring search filter.
+ */
+ @NotNull()
+ public static Filter substring(@NotNull final String attributeName,
+ @Nullable final byte[] subInitial,
+ @Nullable final byte[][] subAny,
+ @Nullable final byte[] subFinal)
+ {
+ return createSubstringFilter(attributeName, subInitial, subAny, subFinal);
+ }
+
+
+
+ /**
+ * Creates a new substring search filter with the provided information. At
+ * least one of the subInitial, subAny, and subFinal components must not be
+ * {@code null}.
+ *
+ * @param attributeName The attribute name for this substring filter. It
+ * must not be {@code null}.
+ * @param subInitial The subInitial component for this substring filter.
+ * @param subAny The set of subAny components for this substring
+ * filter.
+ * @param subFinal The subFinal component for this substring filter.
+ *
+ * @return The created substring search filter.
+ */
+ @NotNull()
public static Filter createSubstringFilter(
@NotNull final String attributeName,
@Nullable final String subInitial,
@@ -826,6 +1030,10 @@
/**
* Creates a new substring search filter with only a subInitial (starts with)
* component.
+ * <BR><BR>
+ * This method does exactly the same thing as
+ * {@link #createSubInitialFilter(String,String)}, but with a shorter method
+ * name for convenience.
*
* @param attributeName The attribute name for this substring filter. It
* must not be {@code null}.
@@ -835,6 +1043,50 @@
* @return The created substring search filter.
*/
@NotNull()
+ public static Filter subInitial(@NotNull final String attributeName,
+ @NotNull final String subInitial)
+ {
+ return createSubInitialFilter(attributeName, subInitial);
+ }
+
+
+
+ /**
+ * Creates a new substring search filter with only a subInitial (starts with)
+ * component.
+ * <BR><BR>
+ * This method does exactly the same thing as
+ * {@link #createSubInitialFilter(String,byte[])}, but with a shorter method
+ * name for convenience.
+ *
+ * @param attributeName The attribute name for this substring filter. It
+ * must not be {@code null}.
+ * @param subInitial The subInitial component for this substring filter.
+ * It must not be {@code null}.
+ *
+ * @return The created substring search filter.
+ */
+ @NotNull()
+ public static Filter subInitial(@NotNull final String attributeName,
+ @NotNull final byte[] subInitial)
+ {
+ return createSubInitialFilter(attributeName, subInitial);
+ }
+
+
+
+ /**
+ * Creates a new substring search filter with only a subInitial (starts with)
+ * component.
+ *
+ * @param attributeName The attribute name for this substring filter. It
+ * must not be {@code null}.
+ * @param subInitial The subInitial component for this substring filter.
+ * It must not be {@code null}.
+ *
+ * @return The created substring search filter.
+ */
+ @NotNull()
public static Filter createSubInitialFilter(
@NotNull final String attributeName,
@NotNull final String subInitial)
@@ -868,6 +1120,10 @@
/**
* Creates a new substring search filter with only a subAny (contains)
* component.
+ * <BR><BR>
+ * This method does exactly the same thing as
+ * {@link #createSubAnyFilter(String,String...)}, but with a shorter method
+ * name for convenience.
*
* @param attributeName The attribute name for this substring filter. It
* must not be {@code null}.
@@ -877,6 +1133,50 @@
* @return The created substring search filter.
*/
@NotNull()
+ public static Filter subAny(@NotNull final String attributeName,
+ @NotNull final String... subAny)
+ {
+ return createSubAnyFilter(attributeName, subAny);
+ }
+
+
+
+ /**
+ * Creates a new substring search filter with only a subAny (contains)
+ * component.
+ * <BR><BR>
+ * This method does exactly the same thing as
+ * {@link #createSubAnyFilter(String,byte[]...)}, but with a shorter method
+ * name for convenience.
+ *
+ * @param attributeName The attribute name for this substring filter. It
+ * must not be {@code null}.
+ * @param subAny The subAny values for this substring filter. It
+ * must not be {@code null} or empty.
+ *
+ * @return The created substring search filter.
+ */
+ @NotNull()
+ public static Filter subAny(@NotNull final String attributeName,
+ @NotNull final byte[]... subAny)
+ {
+ return createSubAnyFilter(attributeName, subAny);
+ }
+
+
+
+ /**
+ * Creates a new substring search filter with only a subAny (contains)
+ * component.
+ *
+ * @param attributeName The attribute name for this substring filter. It
+ * must not be {@code null}.
+ * @param subAny The subAny values for this substring filter. It
+ * must not be {@code null} or empty.
+ *
+ * @return The created substring search filter.
+ */
+ @NotNull()
public static Filter createSubAnyFilter(@NotNull final String attributeName,
@NotNull final String... subAny)
{
@@ -908,6 +1208,10 @@
/**
* Creates a new substring search filter with only a subFinal (ends with)
* component.
+ * <BR><BR>
+ * This method does exactly the same thing as
+ * {@link #createSubFinalFilter(String,String)}, but with a shorter method
+ * name for convenience.
*
* @param attributeName The attribute name for this substring filter. It
* must not be {@code null}.
@@ -917,6 +1221,50 @@
* @return The created substring search filter.
*/
@NotNull()
+ public static Filter subFinal(@NotNull final String attributeName,
+ @NotNull final String subFinal)
+ {
+ return createSubFinalFilter(attributeName, subFinal);
+ }
+
+
+
+ /**
+ * Creates a new substring search filter with only a subFinal (ends with)
+ * component.
+ * <BR><BR>
+ * This method does exactly the same thing as
+ * {@link #createSubFinalFilter(String,byte[])}, but with a shorter method
+ * name for convenience.
+ *
+ * @param attributeName The attribute name for this substring filter. It
+ * must not be {@code null}.
+ * @param subFinal The subFinal component for this substring filter.
+ * It must not be {@code null}.
+ *
+ * @return The created substring search filter.
+ */
+ @NotNull()
+ public static Filter subFinal(@NotNull final String attributeName,
+ @NotNull final byte[] subFinal)
+ {
+ return createSubFinalFilter(attributeName, subFinal);
+ }
+
+
+
+ /**
+ * Creates a new substring search filter with only a subFinal (ends with)
+ * component.
+ *
+ * @param attributeName The attribute name for this substring filter. It
+ * must not be {@code null}.
+ * @param subFinal The subFinal component for this substring filter.
+ * It must not be {@code null}.
+ *
+ * @return The created substring search filter.
+ */
+ @NotNull()
public static Filter createSubFinalFilter(@NotNull final String attributeName,
@NotNull final String subFinal)
{
@@ -947,6 +1295,10 @@
/**
* Creates a new greater-or-equal search filter with the provided information.
+ * <BR><BR>
+ * This method does exactly the same thing as
+ * {@link #createGreaterOrEqualFilter(String,String)}, but with a shorter
+ * method name for convenience.
*
* @param attributeName The attribute name for this greater-or-equal
* filter. It must not be {@code null}.
@@ -956,6 +1308,48 @@
* @return The created greater-or-equal search filter.
*/
@NotNull()
+ public static Filter greaterOrEqual(@NotNull final String attributeName,
+ @NotNull final String assertionValue)
+ {
+ return createGreaterOrEqualFilter(attributeName, assertionValue);
+ }
+
+
+
+ /**
+ * Creates a new greater-or-equal search filter with the provided information.
+ * <BR><BR>
+ * This method does exactly the same thing as
+ * {@link #createGreaterOrEqualFilter(String,byte[])}, but with a shorter
+ * method name for convenience.
+ *
+ * @param attributeName The attribute name for this greater-or-equal
+ * filter. It must not be {@code null}.
+ * @param assertionValue The assertion value for this greater-or-equal
+ * filter. It must not be {@code null}.
+ *
+ * @return The created greater-or-equal search filter.
+ */
+ @NotNull()
+ public static Filter greaterOrEqual(@NotNull final String attributeName,
+ @NotNull final byte[] assertionValue)
+ {
+ return createGreaterOrEqualFilter(attributeName, assertionValue);
+ }
+
+
+
+ /**
+ * Creates a new greater-or-equal search filter with the provided information.
+ *
+ * @param attributeName The attribute name for this greater-or-equal
+ * filter. It must not be {@code null}.
+ * @param assertionValue The assertion value for this greater-or-equal
+ * filter. It must not be {@code null}.
+ *
+ * @return The created greater-or-equal search filter.
+ */
+ @NotNull()
public static Filter createGreaterOrEqualFilter(
@NotNull final String attributeName,
@NotNull final String assertionValue)
@@ -1019,6 +1413,10 @@
/**
* Creates a new less-or-equal search filter with the provided information.
+ * <BR><BR>
+ * This method does exactly the same thing as
+ * {@link #createLessOrEqualFilter(String,String)}, but with a shorter method
+ * name for convenience.
*
* @param attributeName The attribute name for this less-or-equal
* filter. It must not be {@code null}.
@@ -1028,6 +1426,48 @@
* @return The created less-or-equal search filter.
*/
@NotNull()
+ public static Filter lessOrEqual(@NotNull final String attributeName,
+ @NotNull final String assertionValue)
+ {
+ return createLessOrEqualFilter(attributeName, assertionValue);
+ }
+
+
+
+ /**
+ * Creates a new less-or-equal search filter with the provided information.
+ * <BR><BR>
+ * This method does exactly the same thing as
+ * {@link #createLessOrEqualFilter(String,byte[])}, but with a shorter method
+ * name for convenience.
+ *
+ * @param attributeName The attribute name for this less-or-equal
+ * filter. It must not be {@code null}.
+ * @param assertionValue The assertion value for this less-or-equal
+ * filter. It must not be {@code null}.
+ *
+ * @return The created less-or-equal search filter.
+ */
+ @NotNull()
+ public static Filter lessOrEqual(@NotNull final String attributeName,
+ @NotNull final byte[] assertionValue)
+ {
+ return createLessOrEqualFilter(attributeName, assertionValue);
+ }
+
+
+
+ /**
+ * Creates a new less-or-equal search filter with the provided information.
+ *
+ * @param attributeName The attribute name for this less-or-equal
+ * filter. It must not be {@code null}.
+ * @param assertionValue The assertion value for this less-or-equal
+ * filter. It must not be {@code null}.
+ *
+ * @return The created less-or-equal search filter.
+ */
+ @NotNull()
public static Filter createLessOrEqualFilter(
@NotNull final String attributeName,
@NotNull final String assertionValue)
@@ -1091,6 +1531,10 @@
/**
* Creates a new presence search filter with the provided information.
+ * <BR><BR>
+ * This method does exactly the same thing as
+ * {@link #createPresenceFilter(String)}, but with a shorter method name for
+ * convenience.
*
* @param attributeName The attribute name for this presence filter. It
* must not be {@code null}.
@@ -1098,6 +1542,22 @@
* @return The created presence search filter.
*/
@NotNull()
+ public static Filter present(@NotNull final String attributeName)
+ {
+ return createPresenceFilter(attributeName);
+ }
+
+
+
+ /**
+ * Creates a new presence search filter with the provided information.
+ *
+ * @param attributeName The attribute name for this presence filter. It
+ * must not be {@code null}.
+ *
+ * @return The created presence search filter.
+ */
+ @NotNull()
public static Filter createPresenceFilter(@NotNull final String attributeName)
{
Validator.ensureNotNull(attributeName);
@@ -1111,6 +1571,10 @@
/**
* Creates a new approximate match search filter with the provided
* information.
+ * <BR><BR>
+ * This method does exactly the same thing as
+ * {@link #createApproximateMatchFilter(String,String)}, but with a shorter
+ * method name for convenience.
*
* @param attributeName The attribute name for this approximate match
* filter. It must not be {@code null}.
@@ -1120,6 +1584,50 @@
* @return The created approximate match search filter.
*/
@NotNull()
+ public static Filter approximateMatch(@NotNull final String attributeName,
+ @NotNull final String assertionValue)
+ {
+ return createApproximateMatchFilter(attributeName, assertionValue);
+ }
+
+
+
+ /**
+ * Creates a new approximate match search filter with the provided
+ * information.
+ * <BR><BR>
+ * This method does exactly the same thing as
+ * {@link #createApproximateMatchFilter(String,byte[])}, but with a shorter
+ * method name for convenience.
+ *
+ * @param attributeName The attribute name for this approximate match
+ * filter. It must not be {@code null}.
+ * @param assertionValue The assertion value for this approximate match
+ * filter. It must not be {@code null}.
+ *
+ * @return The created approximate match search filter.
+ */
+ @NotNull()
+ public static Filter approximateMatch(@NotNull final String attributeName,
+ @NotNull final byte[] assertionValue)
+ {
+ return createApproximateMatchFilter(attributeName, assertionValue);
+ }
+
+
+
+ /**
+ * Creates a new approximate match search filter with the provided
+ * information.
+ *
+ * @param attributeName The attribute name for this approximate match
+ * filter. It must not be {@code null}.
+ * @param assertionValue The assertion value for this approximate match
+ * filter. It must not be {@code null}.
+ *
+ * @return The created approximate match search filter.
+ */
+ @NotNull()
public static Filter createApproximateMatchFilter(
@NotNull final String attributeName,
@NotNull final String assertionValue)
@@ -1187,6 +1695,10 @@
* Creates a new extensible match search filter with the provided
* information. At least one of the attribute name and matching rule ID must
* be specified, and the assertion value must always be present.
+ * <BR><BR>
+ * This method does exactly the same thing as
+ * {@link #createExtensibleMatchFilter(String,String,boolean,String)}, but
+ * with a shorter method name for convenience.
*
* @param attributeName The attribute name for this extensible match
* filter.
@@ -1200,6 +1712,66 @@
* @return The created extensible match search filter.
*/
@NotNull()
+ public static Filter extensibleMatch(@Nullable final String attributeName,
+ @Nullable final String matchingRuleID,
+ final boolean dnAttributes,
+ @NotNull final String assertionValue)
+ {
+ return createExtensibleMatchFilter(attributeName, matchingRuleID,
+ dnAttributes, assertionValue);
+ }
+
+
+
+ /**
+ * Creates a new extensible match search filter with the provided
+ * information. At least one of the attribute name and matching rule ID must
+ * be specified, and the assertion value must always be present.
+ * <BR><BR>
+ * This method does exactly the same thing as
+ * {@link #createExtensibleMatchFilter(String,String,boolean,byte[])}, but
+ * with a shorter method name for convenience.
+ *
+ * @param attributeName The attribute name for this extensible match
+ * filter.
+ * @param matchingRuleID The matching rule ID for this extensible match
+ * filter.
+ * @param dnAttributes Indicates whether the match should be performed
+ * against attributes in the target entry's DN.
+ * @param assertionValue The assertion value for this extensible match
+ * filter. It must not be {@code null}.
+ *
+ * @return The created extensible match search filter.
+ */
+ @NotNull()
+ public static Filter extensibleMatch(@Nullable final String attributeName,
+ @Nullable final String matchingRuleID,
+ final boolean dnAttributes,
+ @NotNull final byte[] assertionValue)
+ {
+ return createExtensibleMatchFilter(attributeName, matchingRuleID,
+ dnAttributes, assertionValue);
+ }
+
+
+
+ /**
+ * Creates a new extensible match search filter with the provided
+ * information. At least one of the attribute name and matching rule ID must
+ * be specified, and the assertion value must always be present.
+ *
+ * @param attributeName The attribute name for this extensible match
+ * filter.
+ * @param matchingRuleID The matching rule ID for this extensible match
+ * filter.
+ * @param dnAttributes Indicates whether the match should be performed
+ * against attributes in the target entry's DN.
+ * @param assertionValue The assertion value for this extensible match
+ * filter. It must not be {@code null}.
+ *
+ * @return The created extensible match search filter.
+ */
+ @NotNull()
public static Filter createExtensibleMatchFilter(
@Nullable final String attributeName,
@Nullable final String matchingRuleID,
@@ -4696,11 +5268,11 @@
case FILTER_TYPE_OR:
if (filterType == FILTER_TYPE_AND)
{
- buffer.append("Filter.createANDFilter(");
+ buffer.append("Filter.and(");
}
else
{
- buffer.append("Filter.createORFilter(");
+ buffer.append("Filter.or(");
}
if (filterComps.length == 0)
{
@@ -4735,7 +5307,7 @@
case FILTER_TYPE_NOT:
- buffer.append("Filter.createNOTFilter(");
+ buffer.append("Filter.not(");
lineList.add(buffer.toString());
final String suffix;
@@ -4751,7 +5323,7 @@
return;
case FILTER_TYPE_PRESENCE:
- buffer.append("Filter.createPresenceFilter(");
+ buffer.append("Filter.present(");
lineList.add(buffer.toString());
buffer.setLength(0);
@@ -4775,19 +5347,19 @@
case FILTER_TYPE_APPROXIMATE_MATCH:
if (filterType == FILTER_TYPE_EQUALITY)
{
- buffer.append("Filter.createEqualityFilter(");
+ buffer.append("Filter.equals(");
}
else if (filterType == FILTER_TYPE_GREATER_OR_EQUAL)
{
- buffer.append("Filter.createGreaterOrEqualFilter(");
+ buffer.append("Filter.greaterOrEqual(");
}
else if (filterType == FILTER_TYPE_LESS_OR_EQUAL)
{
- buffer.append("Filter.createLessOrEqualFilter(");
+ buffer.append("Filter.lessOrEqual(");
}
else
{
- buffer.append("Filter.createApproximateMatchFilter(");
+ buffer.append("Filter.approximateMatch(");
}
lineList.add(buffer.toString());
@@ -4828,7 +5400,7 @@
case FILTER_TYPE_SUBSTRING:
- buffer.append("Filter.createSubstringFilter(");
+ buffer.append("Filter.substring(");
lineList.add(buffer.toString());
buffer.setLength(0);
@@ -4995,7 +5567,7 @@
case FILTER_TYPE_EXTENSIBLE_MATCH:
- buffer.append("Filter.createExtensibleMatchFilter(");
+ buffer.append("Filter.extensibleMatch(");
lineList.add(buffer.toString());
buffer.setLength(0);
Modified: trunk/tests/unit/src/com/unboundid/ldap/sdk/FilterTestCase.java
===================================================================
--- trunk/tests/unit/src/com/unboundid/ldap/sdk/FilterTestCase.java 2023-03-02 21:07:49 UTC (rev 1590)
+++ trunk/tests/unit/src/com/unboundid/ldap/sdk/FilterTestCase.java 2023-03-08 16:35:16 UTC (rev 1591)
@@ -95,7 +95,7 @@
public void testCreateANDFilterEmptyArray()
throws Exception
{
- Filter f = Filter.createANDFilter(new Filter[0]);
+ Filter f = Filter.and(new Filter[0]);
assertEquals(f.getFilterType(), Filter.FILTER_TYPE_AND);
@@ -167,7 +167,7 @@
Filter.create("(foo=bar)")
};
- Filter f = Filter.createANDFilter(filterElements);
+ Filter f = Filter.and(filterElements);
assertEquals(f.getFilterType(), Filter.FILTER_TYPE_AND);
@@ -241,7 +241,7 @@
Filter.create("(e=f)"),
};
- Filter f = Filter.createANDFilter(filterElements);
+ Filter f = Filter.and(filterElements);
assertEquals(f.getFilterType(), Filter.FILTER_TYPE_AND);
@@ -308,7 +308,7 @@
public void testCreateANDFilterNullArray()
throws Exception
{
- Filter.createANDFilter((Filter[]) null);
+ Filter.and((Filter[]) null);
}
@@ -393,7 +393,7 @@
ArrayList<Filter> filterList = new ArrayList<Filter>(1);
filterList.add(Filter.create("(foo=bar)"));
- Filter f = Filter.createANDFilter(filterList);
+ Filter f = Filter.and(filterList);
assertEquals(f.getFilterType(), Filter.FILTER_TYPE_AND);
@@ -465,7 +465,7 @@
filterList.add(Filter.create("(c=d)"));
filterList.add(Filter.create("(e=f)"));
- Filter f = Filter.createANDFilter(filterList);
+ Filter f = Filter.and(filterList);
assertEquals(f.getFilterType(), Filter.FILTER_TYPE_AND);
@@ -532,7 +532,7 @@
public void testCreateANDFilterNullList()
throws Exception
{
- Filter.createANDFilter((ArrayList<Filter>) null);
+ Filter.and((ArrayList<Filter>) null);
}
@@ -547,7 +547,7 @@
public void testCreateORFilterEmptyArray()
throws Exception
{
- Filter f = Filter.createORFilter(new Filter[0]);
+ Filter f = Filter.or(new Filter[0]);
String filterString = f.toString();
assertEquals(filterString, "(|)");
@@ -619,7 +619,7 @@
Filter.create("(foo=bar)")
};
- Filter f = Filter.createORFilter(filterElements);
+ Filter f = Filter.or(filterElements);
assertEquals(f.getFilterType(), Filter.FILTER_TYPE_OR);
@@ -693,7 +693,7 @@
Filter.create("(e=f)"),
};
- Filter f = Filter.createORFilter(filterElements);
+ Filter f = Filter.or(filterElements);
assertEquals(f.getFilterType(), Filter.FILTER_TYPE_OR);
@@ -760,7 +760,7 @@
public void testCreateORFilterNull()
throws Exception
{
- Filter.createORFilter((Filter[]) null);
+ Filter.or((Filter[]) null);
}
@@ -845,7 +845,7 @@
ArrayList<Filter> filterList = new ArrayList<Filter>(1);
filterList.add(Filter.create("(foo=bar)"));
- Filter f = Filter.createORFilter(filterList);
+ Filter f = Filter.or(filterList);
assertEquals(f.getFilterType(), Filter.FILTER_TYPE_OR);
@@ -917,7 +917,7 @@
filterList.add(Filter.create("(c=d)"));
filterList.add(Filter.create("(e=f)"));
- Filter f = Filter.createORFilter(filterList);
+ Filter f = Filter.or(filterList);
assertEquals(f.getFilterType(), Filter.FILTER_TYPE_OR);
@@ -984,7 +984,7 @@
public void testCreateORFilterList()
throws Exception
{
- Filter.createORFilter((ArrayList<Filter>) null);
+ Filter.or((ArrayList<Filter>) null);
}
@@ -997,7 +997,7 @@
public void testCreateNOTFilter()
throws Exception
{
- Filter f = Filter.createNOTFilter(Filter.create("(foo=bar)"));
+ Filter f = Filter.not(Filter.create("(foo=bar)"));
assertEquals(f.getFilterType(), Filter.FILTER_TYPE_NOT);
@@ -1065,7 +1065,7 @@
public void testCreateNOTFilterNull()
throws Exception
{
- Filter.createNOTFilter(null);
+ Filter.not(null);
}
@@ -1080,7 +1080,7 @@
public void testCreateEqualityFilterString()
throws Exception
{
- Filter f = Filter.createEqualityFilter("foo", "bar");
+ Filter f = Filter.equals("foo", "bar");
assertEquals(f.getFilterType(), Filter.FILTER_TYPE_EQUALITY);
@@ -1156,7 +1156,7 @@
public void testCreateEqualityFilterStringNullAttr()
throws Exception
{
- Filter.createEqualityFilter(null, "bar");
+ Filter.equals(null, "bar");
}
@@ -1171,7 +1171,7 @@
public void testCreateEqualityFilterStringNullValue()
throws Exception
{
- Filter.createEqualityFilter("foo", (String) null);
+ Filter.equals("foo", (String) null);
}
@@ -1186,7 +1186,7 @@
public void testCreateEqualityFilterByteArray()
throws Exception
{
- Filter f = Filter.createEqualityFilter("foo", "bar".getBytes("UTF-8"));
+ Filter f = Filter.equals("foo", "bar".getBytes("UTF-8"));
assertEquals(f.getFilterType(), Filter.FILTER_TYPE_EQUALITY);
@@ -1262,7 +1262,7 @@
public void testCreateEqualityFilterByteArrayNullAttr()
throws Exception
{
- Filter.createEqualityFilter(null, "bar".getBytes("UTF-8"));
+ Filter.equals(null, "bar".getBytes("UTF-8"));
}
@@ -1277,7 +1277,7 @@
public void testCreateEqualityFilterByteArrayNullValue()
throws Exception
{
- Filter.createEqualityFilter("foo", (byte[]) null);
+ Filter.equals("foo", (byte[]) null);
}
@@ -1404,12 +1404,12 @@
final String valueString4 = "Smiley Face Emoji \uD83D\uDE00";
final String valueString5 = "U.S. Flag Emoji \uD83C\uDDFA\uD83C\uDDF8";
- final Filter f = Filter.createORFilter(
- Filter.createEqualityFilter("cn", valueString1),
- Filter.createEqualityFilter("cn", valueString2),
- Filter.createEqualityFilter("cn", valueString3),
- Filter.createEqualityFilter("cn", valueString4),
- Filter.createEqualityFilter("cn", valueString5));
+ final Filter f = Filter.or(
+ Filter.equals("cn", valueString1),
+ Filter.equals("cn", valueString2),
+ Filter.equals("cn", valueString3),
+ Filter.equals("cn", valueString4),
+ Filter.equals("cn", valueString5));
assertEquals(f.getFilterType(), Filter.FILTER_TYPE_OR);
@@ -1477,7 +1477,7 @@
public void testCreateSubstringFilterStringSubInitialOnly()
throws Exception
{
- Filter f = Filter.createSubstringFilter("foo", "bar", null, null);
+ Filter f = Filter.substring("foo", "bar", null, null);
assertEquals(f.getFilterType(), Filter.FILTER_TYPE_SUBSTRING);
@@ -1552,7 +1552,7 @@
public void testCreateSubInitialFilterString()
throws Exception
{
- Filter f = Filter.createSubInitialFilter("foo", "bar");
+ Filter f = Filter.subInitial("foo", "bar");
assertEquals(f.getFilterType(), Filter.FILTER_TYPE_SUBSTRING);
@@ -1630,7 +1630,7 @@
{
String[] subAny = { "bar" };
- Filter f = Filter.createSubstringFilter("foo", null, subAny, null);
+ Filter f = Filter.substring("foo", null, subAny, null);
assertEquals(f.getFilterType(), Filter.FILTER_TYPE_SUBSTRING);
@@ -1700,7 +1700,7 @@
public void testCreateSubAnyFilterSingleStringValue()
throws Exception
{
- Filter f = Filter.createSubAnyFilter("foo", "bar");
+ Filter f = Filter.subAny("foo", "bar");
assertEquals(f.getFilterType(), Filter.FILTER_TYPE_SUBSTRING);
@@ -1772,7 +1772,7 @@
{
String[] subAny = { "bar", "baz", "bat" };
- Filter f = Filter.createSubstringFilter("foo", null, subAny, null);
+ Filter f = Filter.substring("foo", null, subAny, null);
assertEquals(f.getFilterType(), Filter.FILTER_TYPE_SUBSTRING);
@@ -1842,7 +1842,7 @@
public void testCreateSubAnyFilterMultipleStringValues()
throws Exception
{
- Filter f = Filter.createSubAnyFilter("foo", "bar", "baz", "bat");
+ Filter f = Filter.subAny("foo", "bar", "baz", "bat");
assertEquals(f.getFilterType(), Filter.FILTER_TYPE_SUBSTRING);
@@ -1912,7 +1912,7 @@
public void testCreateSubstringFilterStringSubFinalOnly()
throws Exception
{
- Filter f = Filter.createSubstringFilter("foo", null, null, "bar");
+ Filter f = Filter.substring("foo", null, null, "bar");
assertEquals(f.getFilterType(), Filter.FILTER_TYPE_SUBSTRING);
@@ -1987,7 +1987,7 @@
public void testCreateSubFinalFilterString()
throws Exception
{
- Filter f = Filter.createSubFinalFilter("foo", "bar");
+ Filter f = Filter.subFinal("foo", "bar");
assertEquals(f.getFilterType(), Filter.FILTER_TYPE_SUBSTRING);
@@ -2065,7 +2065,7 @@
{
String[] subAny = { "baz" };
- Filter f = Filter.createSubstringFilter("foo", "bar", subAny, "bat");
+ Filter f = Filter.substring("foo", "bar", subAny, "bat");
assertEquals(f.getFilterType(), Filter.FILTER_TYPE_SUBSTRING);
@@ -2148,7 +2148,7 @@
{
String[] subAny = { "bar", "baz", "bat" };
- Filter f = Filter.createSubstringFilter("foo", "a", subAny, "c");
+ Filter f = Filter.substring("foo", "a", subAny, "c");
assertEquals(f.getFilterType(), Filter.FILTER_TYPE_SUBSTRING);
@@ -2230,7 +2230,7 @@
public void testCreateSubstringFilterStringNullAttr()
throws Exception
{
- Filter.createSubstringFilter(null, "bar", null, null);
+ Filter.substring(null, "bar", null, null);
}
@@ -2245,7 +2245,7 @@
public void testCreateSubstringFilterStringNullSubstring()
throws Exception
{
- Filter.createSubstringFilter("null", (String) null, null, null);
+ Filter.substring("null", (String) null, null, null);
}
@@ -2261,7 +2261,7 @@
public void testCreateSubstringFilterStringNullSubInitialAndFinalEmptyAny()
throws Exception
{
- Filter.createSubstringFilter("null", null, new String[0], null);
+ Filter.substring("null", null, new String[0], null);
}
@@ -2276,8 +2276,7 @@
public void testCreateSubstringFilterByteArraySubInitialOnly()
throws Exception
{
- Filter f = Filter.createSubstringFilter("foo", "bar".getBytes("UTF-8"),
- null, null);
+ Filter f = Filter.substring("foo", "bar".getBytes("UTF-8"), null, null);
assertEquals(f.getFilterType(), Filter.FILTER_TYPE_SUBSTRING);
@@ -2353,7 +2352,7 @@
public void testCreateSubInitialFilterByteArray()
throws Exception
{
- Filter f = Filter.createSubInitialFilter("foo", "bar".getBytes("UTF-8"));
+ Filter f = Filter.subInitial("foo", "bar".getBytes("UTF-8"));
assertEquals(f.getFilterType(), Filter.FILTER_TYPE_SUBSTRING);
@@ -2431,7 +2430,7 @@
{
byte[][] subAny = { "bar".getBytes("UTF-8") };
- Filter f = Filter.createSubstringFilter("foo", null, subAny, null);
+ Filter f = Filter.substring("foo", null, subAny, null);
assertEquals(f.getFilterType(), Filter.FILTER_TYPE_SUBSTRING);
@@ -2500,7 +2499,7 @@
public void testCreateSubAnyFilterSingleByteArrayValue()
throws Exception
{
- Filter f = Filter.createSubAnyFilter("foo", "bar".getBytes("UTF-8"));
+ Filter f = Filter.subAny("foo", "bar".getBytes("UTF-8"));
assertEquals(f.getFilterType(), Filter.FILTER_TYPE_SUBSTRING);
@@ -2573,7 +2572,7 @@
byte[][] subAny = { "bar".getBytes("UTF-8"), "baz".getBytes("UTF-8"),
"bat".getBytes("UTF-8") };
- Filter f = Filter.createSubstringFilter("foo", null, subAny, null);
+ Filter f = Filter.substring("foo", null, subAny, null);
assertEquals(f.getFilterType(), Filter.FILTER_TYPE_SUBSTRING);
@@ -2643,7 +2642,7 @@
public void testCreateSubAnyFilterMultipleByteArrayValues()
throws Exception
{
- Filter f = Filter.createSubAnyFilter("foo", "bar".getBytes("UTF-8"),
+ Filter f = Filter.subAny("foo", "bar".getBytes("UTF-8"),
"baz".getBytes("UTF-8"), "bat".getBytes("UTF-8"));
assertEquals(f.getFilterType(), Filter.FILTER_TYPE_SUBSTRING);
@@ -2714,8 +2713,7 @@
public void testCreateSubstringFilterByteArraySubFinalOnly()
throws Exception
{
- Filter f = Filter.createSubstringFilter("foo", null, null,
- "bar".getBytes("UTF-8"));
+ Filter f = Filter.substring("foo", null, null, "bar".getBytes("UTF-8"));
assertEquals(f.getFilterType(), Filter.FILTER_TYPE_SUBSTRING);
@@ -2791,7 +2789,7 @@
public void testCreateSubFinalFilterByteArray()
throws Exception
{
- Filter f = Filter.createSubFinalFilter("foo", "bar".getBytes("UTF-8"));
+ Filter f = Filter.subFinal("foo", "bar".getBytes("UTF-8"));
assertEquals(f.getFilterType(), Filter.FILTER_TYPE_SUBSTRING);
@@ -2870,8 +2868,8 @@
{
byte[][] subAny = { "baz".getBytes("UTF-8") };
- Filter f = Filter.createSubstringFilter("foo", "bar".getBytes("UTF-8"),
- subAny, "bat".getBytes("UTF-8"));
+ Filter f = Filter.substring("foo", "bar".getBytes("UTF-8"), subAny,
+ "bat".getBytes("UTF-8"));
assertEquals(f.getFilterType(), Filter.FILTER_TYPE_SUBSTRING);
@@ -2956,8 +2954,8 @@
byte[][] subAny = { "bar".getBytes("UTF-8"), "baz".getBytes("UTF-8"),
"bat".getBytes("UTF-8") };
- Filter f = Filter.createSubstringFilter("foo", "a".getBytes("UTF-8"),
- subAny, "c".getBytes("UTF-8"));
+ Filter f = Filter.substring("foo", "a".getBytes("UTF-8"), subAny,
+ "c".getBytes("UTF-8"));
assertEquals(f.getFilterType(), Filter.FILTER_TYPE_SUBSTRING);
@@ -3039,7 +3037,7 @@
public void testCreateSubstringFilterByteArrayNullAttr()
throws Exception
{
- Filter.createSubstringFilter(null, "bar".getBytes("UTF-8"), null, null);
+ Filter.substring(null, "bar".getBytes("UTF-8"), null, null);
}
@@ -3054,7 +3052,7 @@
public void testCreateSubstringFilterByteArrayNullSubstring()
throws Exception
{
- Filter.createSubstringFilter("null", (byte[]) null, null, null);
+ Filter.substring("null", (byte[]) null, null, null);
}
@@ -3070,7 +3068,7 @@
public void testCreateSubstringFilterByteArrayNullSubInitialAndFinalEmptyAny()
throws Exception
{
- Filter.createSubstringFilter("null", null, new byte[0][], null);
+ Filter.substring("null", null, new byte[0][], null);
}
@@ -3626,8 +3624,7 @@
")"
};
- Filter f = Filter.createSubstringFilter("foo", subInitial, subAny,
- subFinal);
+ Filter f = Filter.substring("foo", subInitial, subAny, subFinal);
assertEquals(f.getFilterType(), Filter.FILTER_TYPE_SUBSTRING);
@@ -3711,7 +3708,7 @@
public void testCreateGreaterOrEqualFilterString()
throws Exception
{
- Filter f = Filter.createGreaterOrEqualFilter("foo", "bar");
+ Filter f = Filter.greaterOrEqual("foo", "bar");
assertEquals(f.getFilterType(), Filter.FILTER_TYPE_GREATER_OR_EQUAL);
@@ -3790,7 +3787,7 @@
public void testCreateGreaterOrEqualFilterStringNullAttr()
throws Exception
{
- Filter.createGreaterOrEqualFilter(null, "bar");
+ Filter.greaterOrEqual(null, "bar");
}
@@ -3805,7 +3802,7 @@
public void testCreateGreaterOrEqualFilterStringNullValue()
throws Exception
{
- Filter.createGreaterOrEqualFilter("foo", (String) null);
+ Filter.greaterOrEqual("foo", (String) null);
}
@@ -3820,8 +3817,7 @@
public void testCreateGreaterOrEqualFilterByteArray()
throws Exception
{
- Filter f = Filter.createGreaterOrEqualFilter("foo",
- "bar".getBytes("UTF-8"));
+ Filter f = Filter.greaterOrEqual("foo", "bar".getBytes("UTF-8"));
assertEquals(f.getFilterType(), Filter.FILTER_TYPE_GREATER_OR_EQUAL);
@@ -3897,7 +3893,7 @@
public void testCreateGreaterOrEqualFilterByteArrayNullAttr()
throws Exception
{
- Filter.createGreaterOrEqualFilter(null, "bar".getBytes("UTF-8"));
+ Filter.greaterOrEqual(null, "bar".getBytes("UTF-8"));
}
@@ -3912,7 +3908,7 @@
public void testCreateGreaterOrEqualFilterByteArrayNullValue()
throws Exception
{
- Filter.createGreaterOrEqualFilter("foo", (byte[]) null);
+ Filter.greaterOrEqual("foo", (byte[]) null);
}
@@ -4035,7 +4031,7 @@
throws Exception
{
String valueString = "\\* Jos\u00e9 Jalape\u00f1o (on a stick) \\*";
- Filter f = Filter.createGreaterOrEqualFilter("foo", valueString);
+ Filter f = Filter.greaterOrEqual("foo", valueString);
assertEquals(f.getFilterType(), Filter.FILTER_TYPE_GREATER_OR_EQUAL);
@@ -4120,7 +4116,7 @@
public void testCreateLessOrEqualFilterString()
throws Exception
{
- Filter f = Filter.createLessOrEqualFilter("foo", "bar");
+ Filter f = Filter.lessOrEqual("foo", "bar");
assertEquals(f.getFilterType(), Filter.FILTER_TYPE_LESS_OR_EQUAL);
@@ -4196,7 +4192,7 @@
public void testCreateLessOrEqualFilterStringNullAttr()
throws Exception
{
- Filter.createLessOrEqualFilter(null, "bar");
+ Filter.lessOrEqual(null, "bar");
}
@@ -4211,7 +4207,7 @@
public void testCreateLessOrEqualFilterStringNullValue()
throws Exception
{
- Filter.createLessOrEqualFilter("foo", (String) null);
+ Filter.lessOrEqual("foo", (String) null);
}
@@ -4226,7 +4222,7 @@
public void testCreateLessOrEqualFilterByteArray()
throws Exception
{
- Filter f = Filter.createLessOrEqualFilter("foo", "bar".getBytes("UTF-8"));
+ Filter f = Filter.lessOrEqual("foo", "bar".getBytes("UTF-8"));
assertEquals(f.getFilterType(), Filter.FILTER_TYPE_LESS_OR_EQUAL);
@@ -4302,7 +4298,7 @@
public void testCreateLessOrEqualFilterByteArrayNullAttr()
throws Exception
{
- Filter.createLessOrEqualFilter(null, "bar".getBytes("UTF-8"));
+ Filter.lessOrEqual(null, "bar".getBytes("UTF-8"));
}
@@ -4317,7 +4313,7 @@
public void testCreateLessOrEqualFilterByteArrayNullValue()
throws Exception
{
- Filter.createLessOrEqualFilter("foo", (byte[]) null);
+ Filter.lessOrEqual("foo", (byte[]) null);
}
@@ -4440,7 +4436,7 @@
throws Exception
{
String valueString = "\\* Jos\u00e9 Jalape\u00f1o (on a stick) \\*";
- Filter f = Filter.createLessOrEqualFilter("foo", valueString);
+ Filter f = Filter.lessOrEqual("foo", valueString);
assertEquals(f.getFilterType(), Filter.FILTER_TYPE_LESS_OR_EQUAL);
@@ -4524,7 +4520,7 @@
public void testCreatePresenceFilter()
throws Exception
{
- Filter f = Filter.createPresenceFilter("foo");
+ Filter f = Filter.present("foo");
assertEquals(f.getFilterType(), Filter.FILTER_TYPE_PRESENCE);
@@ -4594,7 +4590,7 @@
public void testCreatePresenceFilterNullAttr()
throws Exception
{
- Filter.createPresenceFilter(null);
+ Filter.present(null);
}
@@ -4609,7 +4605,7 @@
public void testCreateApproximateMatchFilterString()
throws Exception
{
- Filter f = Filter.createApproximateMatchFilter("foo", "bar");
+ Filter f = Filter.approximateMatch("foo", "bar");
assertEquals(f.getFilterType(), Filter.FILTER_TYPE_APPROXIMATE_MATCH);
@@ -4685,7 +4681,7 @@
public void testCreateApproximateMatchFilterStringNullAttr()
throws Exception
{
- Filter.createApproximateMatchFilter(null, "bar");
+ Filter.approximateMatch(null, "bar");
}
@@ -4700,7 +4696,7 @@
public void testCreateApproximateMatchFilterStringNullValue()
throws Exception
{
- Filter.createApproximateMatchFilter("foo", (String) null);
+ Filter.approximateMatch("foo", (String) null);
}
@@ -4715,8 +4711,7 @@
public void testCreateApproximateMatchFilterByteArray()
throws Exception
{
- Filter f = Filter.createApproximateMatchFilter("foo",
- "bar".getBytes("UTF-8"));
+ Filter f = Filter.approximateMatch("foo", "bar".getBytes("UTF-8"));
assertEquals(f.getFilterType(), Filter.FILTER_TYPE_APPROXIMATE_MATCH);
@@ -4792,7 +4787,7 @@
public void testCreateApproximateMatchFilterByteArrayNullAttr()
throws Exception
{
- Filter.createApproximateMatchFilter(null, "bar".getBytes("UTF-8"));
+ Filter.approximateMatch(null, "bar".getBytes("UTF-8"));
}
@@ -4807,7 +4802,7 @@
public void testCreateApproximateMatchFilterByteArrayNullValue()
throws Exception
{
- Filter.createApproximateMatchFilter("foo", (byte[]) null);
+ Filter.approximateMatch("foo", (byte[]) null);
}
@@ -4930,7 +4925,7 @@
throws Exception
{
String valueString = "\\* Jos\u00e9 Jalape\u00f1o (on a stick) \\*";
- Filter f = Filter.createApproximateMatchFilter("foo", valueString);
+ Filter f = Filter.approximateMatch("foo", valueString);
assertEquals(f.getFilterType(), Filter.FILTER_TYPE_APPROXIMATE_MATCH);
@@ -5016,7 +5011,7 @@
public void testCreateExtensibleMatchFilterStringAttr()
throws Exception
{
- Filter f = Filter.createExtensibleMatchFilter("foo", null, false, "bar");
+ Filter f = Filter.extensibleMatch("foo", null, false, "bar");
assertEquals(f.getFilterType(), Filter.FILTER_TYPE_EXTENSIBLE_MATCH);
@@ -5095,7 +5090,7 @@
public void testCreateExtensibleMatchFilterStringAttrDN()
throws Exception
{
- Filter f = Filter.createExtensibleMatchFilter("foo", null, true, "bar");
+ Filter f = Filter.extensibleMatch("foo", null, true, "bar");
assertEquals(f.getFilterType(), Filter.FILTER_TYPE_EXTENSIBLE_MATCH);
@@ -5174,7 +5169,7 @@
public void testCreateExtensibleMatchFilterStringRuleID()
throws Exception
{
- Filter f = Filter.createExtensibleMatchFilter(null, "foo", false, "bar");
+ Filter f = Filter.extensibleMatch(null, "foo", false, "bar");
assertEquals(f.getFilterType(), Filter.FILTER_TYPE_EXTENSIBLE_MATCH);
@@ -5253,7 +5248,7 @@
public void testCreateExtensibleMatchFilterStringRuleIDDN()
throws Exception
{
- Filter f = Filter.createExtensibleMatchFilter(null, "foo", true, "bar");
+ Filter f = Filter.extensibleMatch(null, "foo", true, "bar");
assertEquals(f.getFilterType(), Filter.FILTER_TYPE_EXTENSIBLE_MATCH);
@@ -5332,7 +5327,7 @@
public void testCreateExtensibleMatchFilterStringAttrRuleID()
throws Exception
{
- Filter f = Filter.createExtensibleMatchFilter("foo", "bar", false, "baz");
+ Filter f = Filter.extensibleMatch("foo", "bar", false, "baz");
assertEquals(f.getFilterType(), Filter.FILTER_TYPE_EXTENSIBLE_MATCH);
@@ -5413,7 +5408,7 @@
public void testCreateExtensibleMatchFilterStringAttrRuleIDDN()
throws Exception
{
- Filter f = Filter.createExtensibleMatchFilter("foo", "bar", true, "baz");
+ Filter f = Filter.extensibleMatch("foo", "bar", true, "baz");
assertEquals(f.getFilterType(), Filter.FILTER_TYPE_EXTENSIBLE_MATCH);
@@ -5490,7 +5485,7 @@
@Test(expectedExceptions = { LDAPSDKUsageException.class })
public void testCreateExtensibleMatchFilterStringNoValue()
{
- Filter.createExtensibleMatchFilter("foo", null, false, (String) null);
+ Filter.extensibleMatch("foo", null, false, (String) null);
}
@@ -5503,7 +5498,7 @@
@Test(expectedExceptions = { LDAPSDKUsageException.class })
public void testCreateExtensibleMatchFilterStringNoAttrOrRuleID()
{
- Filter.createExtensibleMatchFilter(null, null, false, "bar");
+ Filter.extensibleMatch(null, null, false, "bar");
}
@@ -5519,8 +5514,8 @@
public void testCreateExtensibleMatchFilterByteArrayAttr()
throws Exception
{
- Filter f = Filter.createExtensibleMatchFilter("foo", null, false,
- "bar".getBytes("UTF-8"));
+ Filter f = Filter.extensibleMatch("foo", null, false,
+ "bar".getBytes("UTF-8"));
assertEquals(f.getFilterType(), Filter.FILTER_TYPE_EXTENSIBLE_MATCH);
@@ -5599,8 +5594,8 @@
public void testCreateExtensibleMatchFilterByteArrayAttrDN()
throws Exception
{
- Filter f = Filter.createExtensibleMatchFilter("foo", null, true,
- "bar".getBytes("UTF-8"));
+ Filter f = Filter.extensibleMatch("foo", null, true,
+ "bar".getBytes("UTF-8"));
assertEquals(f.getFilterType(), Filter.FILTER_TYPE_EXTENSIBLE_MATCH);
@@ -5679,8 +5674,8 @@
public void testCreateExtensibleMatchFilterByteArrayRuleID()
throws Exception
{
- Filter f = Filter.createExtensibleMatchFilter(null, "foo", false,
- "bar".getBytes("UTF-8"));
+ Filter f = Filter.extensibleMatch(null, "foo", false,
+ "bar".getBytes("UTF-8"));
assertEquals(f.getFilterType(), Filter.FILTER_TYPE_EXTENSIBLE_MATCH);
@@ -5759,8 +5754,8 @@
public void testCreateExtensibleMatchFilterByteArrayRuleIDDN()
throws Exception
{
- Filter f = Filter.createExtensibleMatchFilter(null, "foo", true,
- "bar".getBytes("UTF-8"));
+ Filter f = Filter.extensibleMatch(null, "foo", true,
+ "bar".getBytes("UTF-8"));
assertEquals(f.getFilterType(), Filter.FILTER_TYPE_EXTENSIBLE_MATCH);
@@ -5839,8 +5834,8 @@
public void testCreateExtensibleMatchFilterByteArrayAttrRuleID()
throws Exception
{
- Filter f = Filter.createExtensibleMatchFilter("foo", "bar", false,
- "baz".getBytes("UTF-8"));
+ Filter f = Filter.extensibleMatch("foo", "bar", false,
+ "baz".getBytes("UTF-8"));
assertEquals(f.getFilterType(), Filter.FILTER_TYPE_EXTENSIBLE_MATCH);
@@ -5921,8 +5916,8 @@
public void testCreateExtensibleMatchFilterByteArrayAttrRuleIDDN()
throws Exception
{
- Filter f = Filter.createExtensibleMatchFilter("foo", "bar", true,
- "baz".getBytes("UTF-8"));
+ Filter f = Filter.extensibleMatch("foo", "bar", true,
+ "baz".getBytes("UTF-8"));
assertEquals(f.getFilterType(), Filter.FILTER_TYPE_EXTENSIBLE_MATCH);
@@ -5999,7 +5994,7 @@
@Test(expectedExceptions = { LDAPSDKUsageException.class })
public void testCreateExtensibleMatchFilterByteArrayNoValue()
{
- Filter.createExtensibleMatchFilter("foo", null, false, (byte[]) null);
+ Filter.extensibleMatch("foo", null, false, (byte[]) null);
}
@@ -6015,8 +6010,7 @@
public void testCreateExtensibleMatchFilterByteArrayNoAttrOrRuleID()
throws Exception
{
- Filter.createExtensibleMatchFilter(null, null, false,
- "bar".getBytes("UTF-8"));
+ Filter.extensibleMatch(null, null, false, "bar".getBytes("UTF-8"));
}
@@ -6543,8 +6537,7 @@
throws Exception
{
String valueString = "\\* Jos\u00e9 Jalape\u00f1o (on a stick) \\*";
- Filter f = Filter.createExtensibleMatchFilter("foo", null, true,
- valueString);
+ Filter f = Filter.extensibleMatch("foo", null, true, valueString);
assertEquals(f.getFilterType(), Filter.FILTER_TYPE_EXTENSIBLE_MATCH);
@@ -6626,8 +6619,7 @@
throws Exception
{
String valueString = "\\* Jos\u00e9 Jalape\u00f1o (on a stick) \\*";
- Filter f = Filter.createExtensibleMatchFilter(null, "foo", true,
- valueString);
+ Filter f = Filter.extensibleMatch(null, "foo", true, valueString);
assertEquals(f.getFilterType(), Filter.FILTER_TYPE_EXTENSIBLE_MATCH);
@@ -7195,9 +7187,9 @@
{
assertEquals(parsedFilter.matchesEntry(e),
expected.booleanValue());
- assertEquals(Filter.createNOTFilter(parsedFilter).matchesEntry(e),
+ assertEquals(Filter.not(parsedFilter).matchesEntr...
[truncated message content] |