com.unboundid.util
Class Validator

java.lang.Object
  extended by com.unboundid.util.Validator

public final class Validator
extends java.lang.Object

This class provides a number of methods that can be used to enforce constraints on the behavior of SDK methods.


Method Summary
static void ensureFalse(boolean condition)
          Ensures that the provided condition is false.
static void ensureFalse(boolean condition, java.lang.String message)
          Ensures that the provided condition is false.
static void ensureNotNull(java.lang.Object o)
          Ensures that the provided object is not null.
static void ensureNotNull(java.lang.Object o1, java.lang.Object o2)
          Ensures that none of the provided objects is null.
static void ensureNotNull(java.lang.Object o1, java.lang.Object o2, java.lang.Object o3)
          Ensures that none of the provided objects is null.
static void ensureNotNull(java.lang.Object o1, java.lang.Object o2, java.lang.Object o3, java.lang.Object o4)
          Ensures that none of the provided objects is null.
static void ensureNotNull(java.lang.Object o1, java.lang.Object o2, java.lang.Object o3, java.lang.Object o4, java.lang.Object o5)
          Ensures that none of the provided objects is null.
static void ensureNotNullWithMessage(java.lang.Object o, java.lang.String message)
          Ensures that the provided object is not null.
static void ensureTrue(boolean condition)
          Ensures that the provided condition is true.
static void ensureTrue(boolean condition, java.lang.String message)
          Ensures that the provided condition is true.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

ensureNotNull

public static void ensureNotNull(java.lang.Object o)
                          throws LDAPSDKUsageException
Ensures that the provided object is not null.

Parameters:
o - The object to examine.
Throws:
LDAPSDKUsageException - If the provided object is null.

ensureNotNullWithMessage

public static void ensureNotNullWithMessage(java.lang.Object o,
                                            java.lang.String message)
                                     throws LDAPSDKUsageException
Ensures that the provided object is not null.

Parameters:
o - The object to examine.
message - The message to include in the exception thrown if the provided object is null.
Throws:
LDAPSDKUsageException - If the provided object is null.

ensureNotNull

public static void ensureNotNull(java.lang.Object o1,
                                 java.lang.Object o2)
                          throws LDAPSDKUsageException
Ensures that none of the provided objects is null.

Parameters:
o1 - The first object for which to make the determination.
o2 - The second object for which to make the determination.
Throws:
LDAPSDKUsageException - If any of the provided objects is null.

ensureNotNull

public static void ensureNotNull(java.lang.Object o1,
                                 java.lang.Object o2,
                                 java.lang.Object o3)
                          throws LDAPSDKUsageException
Ensures that none of the provided objects is null.

Parameters:
o1 - The first object for which to make the determination.
o2 - The second object for which to make the determination.
o3 - The third object for which to make the determination.
Throws:
LDAPSDKUsageException - If any of the provided objects is null.

ensureNotNull

public static void ensureNotNull(java.lang.Object o1,
                                 java.lang.Object o2,
                                 java.lang.Object o3,
                                 java.lang.Object o4)
                          throws LDAPSDKUsageException
Ensures that none of the provided objects is null.

Parameters:
o1 - The first object for which to make the determination.
o2 - The second object for which to make the determination.
o3 - The third object for which to make the determination.
o4 - The fourth object for which to make the determination.
Throws:
LDAPSDKUsageException - If any of the provided objects is null.

ensureNotNull

public static void ensureNotNull(java.lang.Object o1,
                                 java.lang.Object o2,
                                 java.lang.Object o3,
                                 java.lang.Object o4,
                                 java.lang.Object o5)
                          throws LDAPSDKUsageException
Ensures that none of the provided objects is null.

Parameters:
o1 - The first object for which to make the determination.
o2 - The second object for which to make the determination.
o3 - The third object for which to make the determination.
o4 - The fourth object for which to make the determination.
o5 - The fifth object for which to make the determination.
Throws:
LDAPSDKUsageException - If any of the provided objects is null.

ensureTrue

public static void ensureTrue(boolean condition)
                       throws LDAPSDKUsageException
Ensures that the provided condition is true.

Parameters:
condition - The condition to verify.
Throws:
LDAPSDKUsageException - If the provided condition is false.

ensureTrue

public static void ensureTrue(boolean condition,
                              java.lang.String message)
                       throws LDAPSDKUsageException
Ensures that the provided condition is true.

Parameters:
condition - The condition to verify.
message - The message to include in the exception thrown if the provided object is null.
Throws:
LDAPSDKUsageException - If the provided condition is false.

ensureFalse

public static void ensureFalse(boolean condition)
                        throws LDAPSDKUsageException
Ensures that the provided condition is false.

Parameters:
condition - The condition to verify.
Throws:
LDAPSDKUsageException - If the provided condition is true.

ensureFalse

public static void ensureFalse(boolean condition,
                               java.lang.String message)
                        throws LDAPSDKUsageException
Ensures that the provided condition is false.

Parameters:
condition - The condition to verify.
message - The message to include in the exception thrown if the provided object is null.
Throws:
LDAPSDKUsageException - If the provided condition is true.