com.atlassian.jira.util.dbc
Class Assertions

java.lang.Object
  extended by com.atlassian.jira.util.dbc.Assertions

public final class Assertions
extends Object

Utility class with design by contract checks. Should be preferred to Null.

Since:
v3.13

Method Summary
static Object equals(String name, Object expected, Object got)
           
static void not(String name, boolean condition)
          Throw an IllegalArgumentException if the condition is true
static String notBlank(String name, String string)
           
static Object notNull(String name, Object notNull)
           
static Object stateNotNull(String name, Object notNull)
           
static void stateTrue(String name, boolean condition)
          State check.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

notNull

public static Object notNull(String name,
                             Object notNull)
                      throws IllegalArgumentException
Throws:
IllegalArgumentException

notBlank

public static String notBlank(String name,
                              String string)
                       throws IllegalArgumentException
Throws:
IllegalArgumentException

not

public static void not(String name,
                       boolean condition)
                throws IllegalArgumentException
Throw an IllegalArgumentException if the condition is true

Parameters:
name -
condition -
Throws:
IllegalArgumentException

stateTrue

public static void stateTrue(String name,
                             boolean condition)
                      throws IllegalStateException
State check. Throw an IllegalStateException if the condition is false

Parameters:
name -
condition -
Throws:
IllegalStateException

stateNotNull

public static Object stateNotNull(String name,
                                  Object notNull)

equals

public static Object equals(String name,
                            Object expected,
                            Object got)
                     throws IllegalArgumentException
Throws:
IllegalArgumentException


Copyright © 2002-2008 Atlassian. All Rights Reserved.