FileDocCategorySizeDatePackage
Assert.javaAPI DocGlassfish v2 API3261Fri May 04 22:34:10 BST 2007com.sun.enterprise.admin.util

Assert

public class Assert extends Object
Use Assert to checkpoint conditions within the code.

Fields Summary
Constructors Summary
Methods Summary
public static final voidassertRange(int value, int min, int max, java.lang.Object msgIn)

		assertRange( (long)value, (long)min, (long)max, msgIn );
	
public static final voidassertRange(long value, long min, long max, java.lang.Object msgIn)

		if ( value < min || value > max )
		{
			String	rangeString	= "[" + min + ", " + max + "]";
			String	msg	= "illegal integer value = " + value +
				" must be in range " + rangeString;
				
			if ( msgIn != null )
			{
				msg	+= " ( " + msgIn + " )";
			}
			
			throwIt( msg );
		}
	
public static final voidassertit(boolean assertIsTrue, java.lang.Object msg)
If expression is false, throw an AssertError which incorporates the message.

If expression is true, do nothing.

param
assertIsTrue boolean derived from callers expression.
param
msg message to be added to AssertError upon failure

		if ( ! assertIsTrue )
		{
			throwIt( msg.toString() );
		}
	
private static final voidthrowIt(java.lang.String msg)

		AssertError	e	= new AssertError( msg );
		// always print it here, so it will be seen
		e.printStackTrace();
		throw e;