|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.emf.ecp.common.spi.asserts.Assert<T>
T
- the type of the object the Assert
class verifies.public final class Assert<T>
Class for checking the validity of a provided object.
Method Summary | ||
---|---|---|
T |
check()
Usage example: Assert.create(Object object).notNull().ofClass(Class clazz).check() . |
|
static
|
create(T object)
|
|
Assert<T> |
notNull()
Checks if the object is null, in which case an IllegalArgumentException is thrown. |
|
Assert<?> |
ofClass(Class<?> clazz)
Checks if the object has a different type than the Class provided as parameter, in which case an IllegalArgumentException is thrown. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static <T> Assert<T> create(T object)
T
- the type of the object the Assert
class verifies.object
- the object that will be checked
Assert
class.public Assert<T> notNull()
IllegalArgumentException
is thrown.
Assert
instance, when no exception is thrown.public Assert<?> ofClass(Class<?> clazz)
IllegalArgumentException
is thrown.
clazz
- the Class
against which the type of the object is checked.
Assert
instance, when no exception is thrown.public T check()
Assert.create(Object object).notNull().ofClass(Class clazz).check()
.
Assert
is created.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |