satin.common.assertion
Class Ensure

java.lang.Object
  |
  +--satin.common.assertion.Ensure

public abstract class Ensure
extends java.lang.Object

Wrapper for output requirement functions. Objects of this class cannot be instantiated.

Author:
Ed Stauff

Method Summary
static void condition(boolean condition)
          Throws an OutputRequirement if the condition is false.
static void condition(boolean condition, java.lang.String descr)
          Throws an OutputRequirement if the condition is false.
static void inRange(long value, long min, long max)
          Throws an OutputRequirement if the value is out of range.
static void inRange(long value, long min, long max, java.lang.String descr)
          Throws an OutputRequirement if the value is out of range.
static void notNull(java.lang.Object obj)
          Throws an OutputRequirement if the object is null.
static void notNull(java.lang.Object obj, java.lang.String descr)
          Throws an OutputRequirement if the object is null.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

notNull

public static void notNull(java.lang.Object obj)
Throws an OutputRequirement if the object is null.

Parameters:
obj
the object which had better not be null.
Throws:
OutputRequirement -  

notNull

public static void notNull(java.lang.Object obj,
                           java.lang.String descr)
Throws an OutputRequirement if the object is null.

Parameters:
obj
the object which had better not be null.
descr
a description of the object.
Throws:
OutputRequirement -  

inRange

public static void inRange(long value,
                           long min,
                           long max)
Throws an OutputRequirement if the value is out of range.

Parameters:
value
the value to be tested.
min
the minimum legal value (inclusive).
max
the maximum legal value (inclusive).
Throws:
OutputRequirement -  

inRange

public static void inRange(long value,
                           long min,
                           long max,
                           java.lang.String descr)
Throws an OutputRequirement if the value is out of range.

Parameters:
value
the value to be tested.
min
the minimum legal value (inclusive).
max
the maximum legal value (inclusive).
descr
a description of the value.
Throws:
OutputRequirement -  

condition

public static void condition(boolean condition)
Throws an OutputRequirement if the condition is false. Use this only when a more specific Ensure function is not appropriate.

Parameters:
condition
the condition which had better be true.
Throws:
OutputRequirement -  

condition

public static void condition(boolean condition,
                             java.lang.String descr)
Throws an OutputRequirement if the condition is false. Use this only when a more specific Ensure function is not appropriate.

Parameters:
condition
the condition which had better be true.
descr
a description of the condition.
Throws:
OutputRequirement -  
Revision History

5/31/01 Ed Stauff - made changes to docs per initial code review.

20 March 2001 - reviewed by Test Automation team.



Generated on 5/9/2001 19:37 from Ensure.java (PRIVATE SOURCES)