Class Preconditions
java.lang.Object
enterprises.iwakura.sigewine.utils.Preconditions
Utility class providing common validation methods for the Sigewine framework.
This class contains static methods to validate various conditions, such as the presence of constructors, annotations, and method return types.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidcheckAnnotated(Class<?> clazz, Class<RomaritimeBean> romaritimeClass) Checks if the class is annotated with the specified annotation.static voidcheckNoArgConstructor(Class<?> clazz) Validates that the class has a no-argument constructor.static voidcheckNoPrimitiveReturnType(Method method) Checks if the method has a primitive return type.static voidcheckNoVoidReturnType(Method method) Checks if the method has a void return type.static voidcheckOneConstructor(Class<?> clazz) Checks if the class has exactly one constructor.static <E> voidChecks if the class is annotated with the specified annotation.
-
Method Details
-
checkNoArgConstructor
Validates that the class has a no-argument constructor.- Parameters:
clazz- The class to validate.- Throws:
IllegalArgumentException- if the class does not have a no-argument constructor.
-
checkOneConstructor
Checks if the class has exactly one constructor.- Parameters:
clazz- Class to check- Throws:
IllegalArgumentException- if the class does not have exactly one constructor
-
checkNoVoidReturnType
Checks if the method has a void return type.- Parameters:
method- Method to check- Throws:
IllegalArgumentException- if the method has a void return type
-
checkNoPrimitiveReturnType
Checks if the method has a primitive return type.- Parameters:
method- Method to check- Throws:
IllegalArgumentException- if the method has a primitive return type
-
checkAnnotated
Checks if the class is annotated with the specified annotation.- Parameters:
clazz- Class to checkromaritimeClass- Annotation class to check
-
isOfType
Checks if the class is annotated with the specified annotation.- Type Parameters:
E- Type of the class- Parameters:
object- Object to checktype- Class to check
-