Package dev.array21.classvalidator
Class ClassValidator
java.lang.Object
dev.array21.classvalidator.ClassValidator
Utility to validate if a Class matches the required specification
- Since:
- 1.0.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvalidateType(T input) Validate an Object to it's class
Required fields should be annotated withRequired
-
Constructor Details
-
ClassValidator
public ClassValidator()
-
-
Method Details
-
validateType
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
-