Class ClassValidator

java.lang.Object
dev.array21.classvalidator.ClassValidator

public class ClassValidator extends Object
Utility to validate if a Class matches the required specification
Since:
1.0.0
  • Constructor Details

    • ClassValidator

      public ClassValidator()
  • Method Details

    • validateType

      public static <T> Pair<Boolean,String> validateType(T input)
      Validate an Object to it's class
      Required fields should be annotated with Required
      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