Class AbstractNumberField<C extends AbstractNumberField<C,​T>,​T extends Number>

    • Constructor Detail

      • AbstractNumberField

        public AbstractNumberField​(SerializableFunction<String,​T> parser,
                                   SerializableFunction<T,​String> formatter,
                                   double absoluteMin,
                                   double absoluteMax,
                                   boolean isInitialValueOptional)
        Sets up the common logic for number fields.

        If isInitialValueOptional is true then the initial value is used only if element has no "value" property value, otherwise element "value" property is ignored and the initial value is set.

        Parameters:
        parser - function to parse the client-side value string into server-side value
        formatter - function to format the server-side value into client-side value string
        absoluteMin - the smallest possible value of the number type of the field, will be used as the default min value at server-side
        absoluteMax - the largest possible value of the number type of the field, will be used as the default max value at server-side
        isInitialValueOptional - if isInitialValueOptional is true then the initial value is used only if element has no "value" property value, otherwise element "value" property is ignored and the initial value is set
      • AbstractNumberField

        public AbstractNumberField​(SerializableFunction<String,​T> parser,
                                   SerializableFunction<T,​String> formatter,
                                   double absoluteMin,
                                   double absoluteMax)
        Sets up the common logic for number fields.
        Parameters:
        parser - function to parse the client-side value string into server-side value
        formatter - function to format the server-side value into client-side value string
        absoluteMin - the smallest possible value of the number type of the field, will be used as the default min value at server-side
        absoluteMax - the largest possible value of the number type of the field, will be used as the default max value at server-side