Class PropertyValidator

    • Method Detail

      • assertOneOrLess

        public static void assertOneOrLess​(String propertyName,
                                           PropertyList properties)
                                    throws ValidationException
        Ensure a property occurs no more than once.
        Parameters:
        propertyName - the property name
        properties - a list of properties to query
        Throws:
        ValidationException - when the specified property occurs more than once
      • assertOneOrMore

        public static void assertOneOrMore​(String propertyName,
                                           PropertyList properties)
                                    throws ValidationException
        Ensure a property occurs at least once.
        Parameters:
        propertyName - the property name
        properties - a list of properties to query
        Throws:
        ValidationException - when the specified property occurs more than once
      • assertOne

        public static void assertOne​(String propertyName,
                                     PropertyList properties)
                              throws ValidationException
        Ensure a property occurs once.
        Parameters:
        propertyName - the property name
        properties - a list of properties to query
        Throws:
        ValidationException - when the specified property does not occur once
      • assertNone

        public static void assertNone​(String propertyName,
                                      PropertyList properties)
                               throws ValidationException
        Ensure a property doesn't occur in the specified list.
        Parameters:
        propertyName - the name of a property
        properties - a list of properties
        Throws:
        ValidationException - thrown when the specified property is found in the list of properties