Skip navigation links

Oracle® Data Integrator Java API Reference
11g Release 1 (11.1.1.7.0)

E17060-04


oracle.odi.domain.util
Class Assert

java.lang.Object
  extended by oracle.odi.domain.util.Assert


public class Assert
extends java.lang.Object

This class is designed as replacement of Spring's Assert, but with support of I18N ODI MessageHandle.
Each method with MessageHandle has version without this argument. In such case it will use default messages. If no arguments is passed to default version of method it will use generic version of message (e.g. "Parameter must be true." instead of "Parameter 'paramName' must be true.").

Since:
release specific (what release of product did this appear in)
Version:
$Header: Assert.java 05-mar-2011.11:34:56 aputseye Exp $
See Also:
ErrorMessageUtils, MessageHandle

Constructor Summary
Assert()
           

 

Method Summary
static void hasLength(java.lang.String text, oracle.odi.internal.util.MessageHandle msgHandle, java.lang.Object... args)
          Assert that a string is not empty; that is, it must not be null and not empty (note: it can contains whitespace characters only - method don't check this case.
static void hasLength(java.lang.String text, java.lang.Object... args)
          Assert that a string is not empty; that is, it must not be null and not empty (note: it can contains whitespace characters only - method don't check this case.
static void hasText(java.lang.String text, oracle.odi.internal.util.MessageHandle msgHandle, java.lang.Object... args)
          Assert that a string has valid text content; that is, it must not be null and must contain at least one non-whitespace character.
static void hasText(java.lang.String text, java.lang.Object... args)
          Assert that a string has valid text content; that is, it must not be null and must contain at least one non-whitespace character.
Default message: Parameter {0} must have text; it must not be null, empty, or blank.
static void isAssignable(java.lang.Class<?> superType, java.lang.Class<?> subType)
          Assert that superType.isAssignableFrom(subType) is true.
Default message: Class {subType} is not assignable to {superType}.
static void isAssignable(java.lang.Class<?> superType, java.lang.Class<?> subType, oracle.odi.internal.util.MessageHandle msgHandle, java.lang.Object... args)
          Assert that superType.isAssignableFrom(subType) is true.
static void isFalse(boolean expression, oracle.odi.internal.util.MessageHandle msgHandle, java.lang.Object... args)
          Assert a boolean expression, throwing DomainRuntimeException if the test result is true.
static void isFalse(boolean expression, java.lang.Object... args)
          Assert a boolean expression, throwing DomainRuntimeException with default message if the test result is true.
static void isInstanceOf(java.lang.Class<?> clazz, java.lang.Object obj, oracle.odi.internal.util.MessageHandle msgHandle, java.lang.Object... args)
          Assert that the provided object is an instance of the provided class.
static void isInstanceOf(java.lang.Class<?> clazz, java.lang.Object obj, java.lang.Object... args)
          Assert that the provided object is an instance of the provided class.
Default message: Parameter '{0}' must be instance of '{clazz}'.
static void isNull(java.lang.Object value, oracle.odi.internal.util.MessageHandle msgHandle, java.lang.Object... args)
          Assert that an object is null.
static void isNull(java.lang.Object value, java.lang.Object... args)
          Assert that an object is null.
Default message: Parameter '{0}' must be null.
static void isTrue(boolean expression, oracle.odi.internal.util.MessageHandle msgHandle, java.lang.Object... args)
          Assert a boolean expression, throwing DomainRuntimeException if the test result is false.
static void isTrue(boolean expression, java.lang.Object... args)
          Assert a boolean expression, throwing DomainRuntimeException with default message if the test result is false.
static void notNull(java.lang.Object value, oracle.odi.internal.util.MessageHandle msgHandle, java.lang.Object... args)
          Assert that an object isn't null.
static void notNull(java.lang.Object value, java.lang.Object... args)
          Assert that an object isn't null.
Default message: Parameter '{0}' must not be null.

 

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

 

Constructor Detail

Assert

public Assert()

Method Detail

isTrue

public static void isTrue(boolean expression,
                          oracle.odi.internal.util.MessageHandle msgHandle,
                          java.lang.Object... args)
Assert a boolean expression, throwing DomainRuntimeException if the test result is false.
Parameters:
expression -
msgHandle -
args -

isTrue

public static void isTrue(boolean expression,
                          java.lang.Object... args)
Assert a boolean expression, throwing DomainRuntimeException with default message if the test result is false.
Default message: Parameter '{0}' must be true.
Parameters:
expression -
args -

isFalse

public static void isFalse(boolean expression,
                           oracle.odi.internal.util.MessageHandle msgHandle,
                           java.lang.Object... args)
Assert a boolean expression, throwing DomainRuntimeException if the test result is true.
Parameters:
expression -
msgHandle -
args -

isFalse

public static void isFalse(boolean expression,
                           java.lang.Object... args)
Assert a boolean expression, throwing DomainRuntimeException with default message if the test result is true.
Default message: Parameter '{0}' must be false.
Parameters:
expression -
args -

isNull

public static void isNull(java.lang.Object value,
                          oracle.odi.internal.util.MessageHandle msgHandle,
                          java.lang.Object... args)
Assert that an object is null.
Parameters:
value -
msgHandle -
args -

isNull

public static void isNull(java.lang.Object value,
                          java.lang.Object... args)
Assert that an object is null.
Default message: Parameter '{0}' must be null.
Parameters:
value -
args -

notNull

public static void notNull(java.lang.Object value,
                           oracle.odi.internal.util.MessageHandle msgHandle,
                           java.lang.Object... args)
Assert that an object isn't null.
Parameters:
value -
msgHandle -
args -

notNull

public static void notNull(java.lang.Object value,
                           java.lang.Object... args)
Assert that an object isn't null.
Default message: Parameter '{0}' must not be null.
Parameters:
value -
args -

isInstanceOf

public static void isInstanceOf(java.lang.Class<?> clazz,
                                java.lang.Object obj,
                                oracle.odi.internal.util.MessageHandle msgHandle,
                                java.lang.Object... args)
Assert that the provided object is an instance of the provided class.
Parameters:
clazz -
obj -
msgHandle -
args -

isInstanceOf

public static void isInstanceOf(java.lang.Class<?> clazz,
                                java.lang.Object obj,
                                java.lang.Object... args)
Assert that the provided object is an instance of the provided class.
Default message: Parameter '{0}' must be instance of '{clazz}'.
Parameters:
clazz -
obj -
args -

isAssignable

public static void isAssignable(java.lang.Class<?> superType,
                                java.lang.Class<?> subType,
                                oracle.odi.internal.util.MessageHandle msgHandle,
                                java.lang.Object... args)
Assert that superType.isAssignableFrom(subType) is true.
Parameters:
superType -
subType -
msgHandle -
args -

isAssignable

public static void isAssignable(java.lang.Class<?> superType,
                                java.lang.Class<?> subType)
Assert that superType.isAssignableFrom(subType) is true.
Default message: Class {subType} is not assignable to {superType}.
Parameters:
superType -
subType -

hasText

public static void hasText(java.lang.String text,
                           oracle.odi.internal.util.MessageHandle msgHandle,
                           java.lang.Object... args)
Assert that a string has valid text content; that is, it must not be null and must contain at least one non-whitespace character.
Parameters:
text -
msgHandle -
args -

hasText

public static void hasText(java.lang.String text,
                           java.lang.Object... args)
Assert that a string has valid text content; that is, it must not be null and must contain at least one non-whitespace character.
Default message: Parameter {0} must have text; it must not be null, empty, or blank.
Parameters:
text -
args -

hasLength

public static void hasLength(java.lang.String text,
                             oracle.odi.internal.util.MessageHandle msgHandle,
                             java.lang.Object... args)
Assert that a string is not empty; that is, it must not be null and not empty (note: it can contains whitespace characters only - method don't check this case. If you need more strict check - use method hasText(String, MessageHandle, Object...)).
Parameters:
text -
msgHandle -
args -

hasLength

public static void hasLength(java.lang.String text,
                             java.lang.Object... args)
Assert that a string is not empty; that is, it must not be null and not empty (note: it can contains whitespace characters only - method don't check this case. If you need more strict check - use method hasText(String, MessageHandle, Object...)).
Default message: Parameter '{0}' must have length; it must not be null or empty.
Parameters:
text -
args -

Skip navigation links

Oracle® Data Integrator Java API Reference
11g Release 1 (11.1.1.7.0)

E17060-04


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