|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectio.nuun.kernel.api.assertions.AssertUtils
public class AssertUtils
Provides assertions commonly used by Nuun plugins.
| Nested Class Summary | |
|---|---|
static class |
AssertUtils.AnnotationCopy
|
| Constructor Summary | |
|---|---|
AssertUtils()
|
|
| Method Summary | ||
|---|---|---|
static
|
annotationProxyOf(Class<A> annotationModelType,
Annotation annotationClone)
|
|
static void |
assertInterface(Class<? extends Object> candidate)
Asserts that the given class is an interface. |
|
static void |
assertionIllegalArgument(boolean asserted,
String message)
Asserts that the given parameter is true, otherwise throws an IllegalArgumentException. |
|
static void |
assertionNullPointer(boolean asserted,
String message)
Asserts that the given parameter is true, otherwise throws an NullPointerException. |
|
static void |
assertIsClass(Class<? extends Object> candidate)
Asserts that the class is not an interface. |
|
static void |
assertLegal(Object underAssertion,
String message)
Asserts that the given parameter is not null, otherwise throws an IllegalArgumentException. |
|
static void |
assertNotNull(Object underAssertion,
String message)
Asserts that the given parameter is not null, otherwise throws an NullPointerException. |
|
static boolean |
hasAnnotationDeep(Class<?> memberDeclaringClass,
Class<? extends Annotation> candidate)
Indicates if a class or at least one of its annotations is annotated by a given annotation. |
|
static boolean |
hasAnnotationDeepRegex(Class<?> memberDeclaringClass,
String metaAnnotationRegex)
Indicates if the class name or at least the name of one of its annotations matches the regex. |
|
static boolean |
isClass(Class<? extends Object> candidate)
Indicates if the class is not an interface. |
|
static boolean |
isEquivalent(Class<? extends Annotation> original,
Class<? extends Annotation> copy)
|
|
static boolean |
isInterface(Class<? extends Object> candidate)
Indicates if the given class is an interface. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AssertUtils()
| Method Detail |
|---|
public static boolean isInterface(Class<? extends Object> candidate)
candidate - the class to check
public static void assertInterface(Class<? extends Object> candidate)
candidate - the class to check
IllegalArgumentException - if the assertion is not satisfiedpublic static boolean isClass(Class<? extends Object> candidate)
candidate - the class to check
public static void assertIsClass(Class<? extends Object> candidate)
candidate - the class to check
IllegalArgumentException - if the assertion is not satisfied
public static boolean hasAnnotationDeep(Class<?> memberDeclaringClass,
Class<? extends Annotation> candidate)
Notice that the classes with a package name starting with "java.lang" will be ignored.
memberDeclaringClass - the class to checkcandidate - the annotation to find
public static boolean hasAnnotationDeepRegex(Class<?> memberDeclaringClass,
String metaAnnotationRegex)
Notice that the classes with a package name starting with "java.lang" will be ignored.
memberDeclaringClass - the class to checkmetaAnnotationRegex - the regex to match
public static boolean isEquivalent(Class<? extends Annotation> original,
Class<? extends Annotation> copy)
public static <A extends Annotation> A annotationProxyOf(Class<A> annotationModelType,
Annotation annotationClone)
public static void assertionIllegalArgument(boolean asserted,
String message)
IllegalArgumentException.
asserted - the assertion resultmessage - the error message
IllegalArgumentException - if asserted is false
public static void assertionNullPointer(boolean asserted,
String message)
NullPointerException.
asserted - the assertion resultmessage - the error message
NullPointerException - if asserted is false
public static void assertLegal(Object underAssertion,
String message)
IllegalArgumentException.
underAssertion - the object to checkmessage - the error message
IllegalArgumentException - if asserted is null
public static void assertNotNull(Object underAssertion,
String message)
NullPointerException.
underAssertion - the object to checkmessage - the error message
NullPointerException - if asserted is null
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||