Class AbstractEnumKeyValueConfigurationValueValidator<D,​T>

    • Constructor Detail

      • AbstractEnumKeyValueConfigurationValueValidator

        protected AbstractEnumKeyValueConfigurationValueValidator​(EnumKeyValueConfigurationDataType valueDataType,
                                                                  java.lang.Class<D> valueClass,
                                                                  EnumKeyValueConfigurationDataType sizeDataType)
        Constructor for AbstractEnumKeyValueConfigurationValueValidator
        Parameters:
        valueDataType - The value data type
        valueClass - the value class
        sizeDataType - the size data type
    • Method Detail

      • parseSizeValue

        public T parseSizeValue​(java.lang.String input)
                         throws ValidationException
        Parse the size value
        Parameters:
        input - the string input, either number or *. In case it's null it will return null
        Returns:
        the parsed result
        Throws:
        ValidationException - In case of invalid data
      • parseValue

        public D parseValue​(java.lang.String input)
                     throws ValidationException
        Parse the size value
        Parameters:
        input - the string input, either number or *. In case it's null it will return null
        Returns:
        the parsed result
        Throws:
        ValidationException - In case of invalid data
      • preapreMinMaxValue

        protected com.github.toolarium.enumeration.configuration.validation.value.impl.AbstractEnumKeyValueConfigurationValueValidator.MinMaxValue<T> preapreMinMaxValue​(EnumKeyValueConfigurationSizing<T> valueSize,
                                                                                                                                                                         java.lang.String inputValue)
                                                                                                                                                                  throws ValidationException
        Prepare min / max value
        Parameters:
        valueSize - the value size
        inputValue - The input value
        Returns:
        the MinMaxValue.
        Throws:
        ValidationException - In case of min / max inconsistency.
      • getMinSize

        public abstract T getMinSize()
        Get the min size.
        Returns:
        the min size.
      • getMaxSize

        public abstract T getMaxSize()
        Get the max size.
        Returns:
        the max size.
      • isGreaterThan

        protected abstract boolean isGreaterThan​(T first,
                                                 T second)
        Validate if the first value is greater than the second.
        Parameters:
        first - value
        second - value
        Returns:
        true if the first is greater than the seconds.
      • isGreaterThanValue

        protected boolean isGreaterThanValue​(java.lang.Number first,
                                             java.lang.Number second)
        Validate if the first value is greater than the second.
        Parameters:
        first - value
        second - value
        Returns:
        true if the first is greater than the seconds.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
        See Also:
        Object.hashCode()
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
        See Also:
        Object.equals(java.lang.Object)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
        See Also:
        Object.toString()