Joda System API

org.joda.util
Class Validation

java.lang.Object
  |
  +--org.joda.util.Validation

public class Validation
extends java.lang.Object

Validation utility. Validation is designed to be used in a similar way to the assert functionality, but when the check needs to be left in at runtime. This class is modelled after JUnit.

Author:
Stephen Colebourne

Method Summary
static void isEquals(java.lang.Object expected, java.lang.Object actual, java.lang.String message)
          Validate for values equal
static void isNotNull(java.lang.Object param, java.lang.String paramName)
          Validate that the parameter is not null.
static void isTrue(boolean arg, java.lang.String message)
          Validate for true boolean.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isNotNull

public static void isNotNull(java.lang.Object param,
                             java.lang.String paramName)
Validate that the parameter is not null.

Parameters:
param - the value to check
paramName - the name of the parameter. The error message will be built by adding ' must not be null'.

isTrue

public static void isTrue(boolean arg,
                          java.lang.String message)
Validate for true boolean.

Parameters:
arg - the boolean to check
message - the error message

isEquals

public static void isEquals(java.lang.Object expected,
                            java.lang.Object actual,
                            java.lang.String message)
Validate for values equal

Parameters:
message - the error message

Joda System API

Copyright © 2001-2003 Stephen Colebourne. All Rights Reserved.