|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.gitective.core.Assert
public abstract class Assert
Assert utilities that all throw IllegalArgumentException that will
have a non-null/non-empty message.
| Constructor Summary | |
|---|---|
Assert()
|
|
| Method Summary | ||
|---|---|---|
static String |
formatNotEmpty(String prefix)
Return formatted not empty message with given prefix |
|
static String |
formatNotNull(String prefix)
Return formatted not null message with given prefix |
|
static String |
notEmpty(String string)
Throw an IllegalArgumentException with a default message if the
string has a length of zero. |
|
static String |
notEmpty(String message,
String string)
Throw an IllegalArgumentException with the message if the string
has a length of zero. |
|
static
|
notEmpty(String message,
V[] objects)
Throw an IllegalArgumentException with the message if the
Object array has a length of zero. |
|
static
|
notEmpty(V[] objects)
Throw an IllegalArgumentException with a default message if the
Object array has a length of zero. |
|
static
|
notNull(String message,
V object)
Throw an IllegalArgumentException with the message if the object
is null. |
|
static
|
notNull(V object)
Throw an IllegalArgumentException with a default message if the
object is null. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Assert()
| Method Detail |
|---|
public static <V> V notNull(String message,
V object)
throws IllegalArgumentException
IllegalArgumentException with the message if the object
is null.
message - object -
IllegalArgumentException
public static <V> V notNull(V object)
throws IllegalArgumentException
IllegalArgumentException with a default message if the
object is null.
object -
IllegalArgumentException
public static <V> V[] notEmpty(String message,
V[] objects)
throws IllegalArgumentException
IllegalArgumentException with the message if the
Object array has a length of zero.
message - objects -
IllegalArgumentException
public static <V> V[] notEmpty(V[] objects)
throws IllegalArgumentException
IllegalArgumentException with a default message if the
Object array has a length of zero.
objects -
IllegalArgumentException
public static String notEmpty(String message,
String string)
throws IllegalArgumentException
IllegalArgumentException with the message if the string
has a length of zero.
message - string -
IllegalArgumentException
public static String notEmpty(String string)
throws IllegalArgumentException
IllegalArgumentException with a default message if the
string has a length of zero.
string -
IllegalArgumentExceptionpublic static String formatNotNull(String prefix)
prefix -
public static String formatNotEmpty(String prefix)
prefix -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||