Class ConfigValidationUtils


  • public class ConfigValidationUtils
    extends Object
    • Constructor Detail

      • ConfigValidationUtils

        public ConfigValidationUtils()
    • Method Detail

      • fv

        public static ConfigValidationUtils.NestableFieldValidator fv​(Class cls,
                                                                      boolean notNull)
        Returns a new NestableFieldValidator for a given class.
        Parameters:
        cls - the Class the field should be a type of
        notNull - whether or not a value of null is valid
        Returns:
        a NestableFieldValidator for that class
      • listFv

        public static ConfigValidationUtils.NestableFieldValidator listFv​(Class cls,
                                                                          boolean notNull)
        Returns a new NestableFieldValidator for a List of the given Class.
        Parameters:
        cls - the Class of elements composing the list
        notNull - whether or not a value of null is valid
        Returns:
        a NestableFieldValidator for a list of the given class
      • listFv

        public static ConfigValidationUtils.NestableFieldValidator listFv​(ConfigValidationUtils.NestableFieldValidator validator,
                                                                          boolean notNull)
        Returns a new NestableFieldValidator for a List where each item is validated by validator.
        Parameters:
        validator - used to validate each item in the list
        notNull - whether or not a value of null is valid
        Returns:
        a NestableFieldValidator for a list with each item validated by a different validator.
      • mapFv

        public static ConfigValidationUtils.NestableFieldValidator mapFv​(Class key,
                                                                         Class val,
                                                                         boolean notNull)
        Returns a new NestableFieldValidator for a Map of key to val.
        Parameters:
        key - the Class of keys in the map
        val - the Class of values in the map
        notNull - whether or not a value of null is valid
        Returns:
        a NestableFieldValidator for a Map of key to val