Class ObjectValidator


  • public final class ObjectValidator
    extends Object
    The ObjectValidator is a sample implementation of how to use the validator.

    The validators was designed to keep in the memory or other cache and validate multiple instances. This implementation creates a new Validator each time and uses the FailFastErrorHandler to validate the instance object.

    • Method Detail

      • validate

        public static boolean validate​(Object node,
                                       Map<String,​Object> schema)
        Validate the given node against the schema

        This implementation is pessimistic and returns false if any exception was thrown.

        Parameters:
        node - instance to validate
        schema - schema for validation
        Returns:
        true if the object does not violates the schema otherwise false