com.starteam.util
Class Assert

java.lang.Object
  extended by com.starteam.util.Assert

public final class Assert
extends java.lang.Object

An internal Assertion mechanism used to throw exceptions as needed Typically, application developers are likely to see one of these thrown exceptions only if they call into SDK api's with NULL arguments which are unexpected. Hence, they are most likely to be caught early in the application development cycle. End user applications, once developed, should not see these exceptions thrown


Method Summary
static void argIsTrue(boolean expr, java.lang.String message)
          Throw an IllegalArgumentException
static void argNotNull(java.lang.Object obj, java.lang.String message)
          Throw an IllegalArgumentException
static void internalError(java.lang.String strContext)
          Throws a SDKRuntimeException indicating that an unexpected, internal error has occurred.
static void internalError(java.lang.String strContext, java.lang.Exception e)
          Throws a SDKRuntimeException indicating that an unexpected, internal error has occurred.
static void isTrue(boolean expr, java.lang.String message)
          Throw a RuntimeException
static void notNull(java.lang.Object obj, java.lang.String message)
          Throw a NullPointerException
static void nullArgument(java.lang.String strClassName)
          Throws an IllegalArgumentException indicating that a null parameter was detected.
static void nullArgument(java.lang.String strClassName, java.lang.String strArgName)
          Throw an IllegalArgumentException
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isTrue

public static final void isTrue(boolean expr,
                                java.lang.String message)
Throw a RuntimeException

Parameters:
expr - the expression that should evaluate to true
message - the message to include in the thrown exception

notNull

public static final void notNull(java.lang.Object obj,
                                 java.lang.String message)
Throw a NullPointerException

Parameters:
obj - The object that should evaluate to null
message - the message to include in the thrown exception

argIsTrue

public static final void argIsTrue(boolean expr,
                                   java.lang.String message)
Throw an IllegalArgumentException

Parameters:
expr - the expression that should evaluate to true
message - the message to include in the thrown exception

argNotNull

public static final void argNotNull(java.lang.Object obj,
                                    java.lang.String message)
Throw an IllegalArgumentException

Parameters:
obj - the object that should evaluate to null
message - the message to include in the thrown exception

internalError

public static void internalError(java.lang.String strContext)
Throws a SDKRuntimeException indicating that an unexpected, internal error has occurred. Should be used for sanity checks and other errors that should not normally occur (unless there is a bug in the SDK or in the Server).

Parameters:
strContext - A string that uniquely identifies this internal error in the source code. Normally includes at least the class name and method name where the exception was triggered (for example, "MyClass.method()"). If that alone is not a unique identifier, then additional context is required. Information that may help to diagnose the problem may also be included, but is not required. strContext should not be localized.

internalError

public static void internalError(java.lang.String strContext,
                                 java.lang.Exception e)
Throws a SDKRuntimeException indicating that an unexpected, internal error has occurred. Should be used for sanity checks and other errors that should not normally occur (unless there is a bug in the SDK or in the Server).

Parameters:
strContext - A string that uniquely identifies this internal error in the source code. Normally includes at least the class name and method name where the exception was triggered (for example, "MyClass.method()"). If that alone is not a unique identifier, then additional context is required. Information that may help to diagnose the problem may also be included, but is not required. strContext should not be localized.
e - an Exception that is aggregated into the thrown container exception

nullArgument

public static void nullArgument(java.lang.String strClassName)
Throws an IllegalArgumentException indicating that a null parameter was detected.

Parameters:
strClassName - The class that represents the parameter type (for example, "String", "GroupAccount", etc.). The class name should not be localized.

nullArgument

public static void nullArgument(java.lang.String strClassName,
                                java.lang.String strArgName)
Throw an IllegalArgumentException

Parameters:
strClassName - The class that represents the parameter type
strArgName - The argument that represents the parameter type


StarTeam SDK 14.0, Build 21
Copyright © 2003-2012 Borland Software Corporation. All rights reserved.