|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.bamboo.performance.Assertions
public final class Assertions
Utility class with design by contract checks. Should be preferred to Null
.
Method Summary | ||
---|---|---|
static
|
containsNoBlanks(java.lang.String name,
C stringsNotBlank)
Throw and IllegalArgumentException if the passed collection is null or contains any blank Strings. |
|
static
|
containsNoNulls(java.lang.String name,
C containsNoNulls)
Throw an IllegalArgumentException if the passed collection is null or contains any null values. |
|
static
|
containsNoNulls(java.lang.String name,
C[] containsNoNulls)
Throw an IllegalArgumentException if the passed array is null or contains any null values. |
|
static
|
equals(java.lang.String name,
T expected,
T got)
|
|
static void |
not(java.lang.String name,
boolean condition)
Throw an IllegalArgumentException if the condition is true |
|
static java.lang.String |
notBlank(java.lang.String name,
java.lang.String string)
Throw an IllegalArgumentException if the string is null or blank (only contains whitespace) |
|
static
|
notNull(java.lang.String name,
T notNull)
Throw an IllegalArgumentException if the string is null |
|
static
|
stateNotNull(java.lang.String name,
T notNull)
State check. |
|
static void |
stateTrue(java.lang.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 |
---|
public static <T> T notNull(java.lang.String name, T notNull) throws java.lang.IllegalArgumentException
name
- added to the exceptionnotNull
- should not be null
java.lang.IllegalArgumentException
- if nullpublic static <C extends java.lang.Iterable<?>> C containsNoNulls(java.lang.String name, C containsNoNulls) throws java.lang.IllegalArgumentException
name
- name added to the exception.containsNoNulls
- the collection to check.
java.lang.IllegalArgumentException
- if the passed collection is null or contains any null.public static <C> C[] containsNoNulls(java.lang.String name, C[] containsNoNulls) throws java.lang.IllegalArgumentException
name
- name added to the exception.containsNoNulls
- the collection to check.
java.lang.IllegalArgumentException
- if the passed collection is null or contains any null.public static java.lang.String notBlank(java.lang.String name, java.lang.String string) throws java.lang.IllegalArgumentException
name
- added to the exceptionstring
- should not be null or blank
java.lang.IllegalArgumentException
- if null or blankpublic static <C extends java.lang.Iterable<java.lang.String>> C containsNoBlanks(java.lang.String name, C stringsNotBlank)
C
- the type of the collection of strings.name
- name added to the exceptionstringsNotBlank
- the collection of strings that should not be blank.
java.lang.IllegalArgumentException
- if the passed collection is null or contains any blank strings.public static void not(java.lang.String name, boolean condition) throws java.lang.IllegalArgumentException
name
- added to the exceptioncondition
- should be false
java.lang.IllegalArgumentException
- if truepublic static void stateTrue(java.lang.String name, boolean condition) throws java.lang.IllegalStateException
name
- added to the exceptioncondition
- should be true
java.lang.IllegalStateException
- if falsepublic static <T> T stateNotNull(java.lang.String name, T notNull)
name
- added to the exceptionnotNull
- should not be null
java.lang.IllegalStateException
- if falsepublic static <T> T equals(java.lang.String name, T expected, T got) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |