Class ClassValidator


  • public class ClassValidator
    extends java.lang.Object
    Utility 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 with Required
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ClassValidator

        public ClassValidator()
    • 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 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