Package dev.array21.classvalidator
Class ClassValidator
- java.lang.Object
-
- dev.array21.classvalidator.ClassValidator
-
public class ClassValidator extends java.lang.ObjectUtility to validate if a Class matches the required specification- Since:
- 1.0.0
-
-
Constructor Summary
Constructors Constructor Description ClassValidator()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> Pair<java.lang.Boolean,java.lang.String>validateType(T input)Validate an Object to it's class
Required fields should be annotated withRequired
-
-
-
Method Detail
-
validateType
public static <T> Pair<java.lang.Boolean,java.lang.String> validateType(T input)
Validate an Object to it's class
Required fields should be annotated withRequired- Type Parameters:
T- Type of input- Parameters:
input- The input- Returns:
- Returns a Pair where:
- If A is null, an exception occurred. Description contained in B.
- If A is false, the object did not pass validation. Description for the user contained in B
- if A is true, the validation passed. B will be null
-
-