Top Description Constructors Methods
uk.ac.ed.ph.snuggletex.internal.util

public final Class ConstraintUtilities

extends Object
Class Inheritance

Simple utility methods for enforcing various types of data constraints.

Some of the functionality here is reproduced in Spring (and in other 3rd party JARs), but we need this to work at the client-side too and may opt not to such 3rd party products there. Regardless, this is trivial anyway! (This is copied from ph-commons-util.)

Author
David McKain
Version
$Revision$

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static void
public static void
ensureNotNull(Object
object to test
value
,
String
name to give to supplied Object when constructing Exception message.
objectName
)

Checks that the given object is non-null, throwing an IllegalArgumentException if the check fails.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ConstraintUtilitiesback to summary
public ConstraintUtilities()

Method Detail

ensureNotNullback to summary
public static void ensureNotNull(Object value)
ensureNotNullback to summary
public static void ensureNotNull(Object value, String objectName)

Checks that the given object is non-null, throwing an IllegalArgumentException if the check fails. If the check succeeds then nothing happens.

Parameters
value:Object

object to test

objectName:String

name to give to supplied Object when constructing Exception message.

Exceptions
IllegalArgumentException:
if an error occurs.