Class NumberFormatOptions.Builder

java.lang.Object
de.xima.fc.form.common.number_format.NumberFormatOptions.Builder
Enclosing class:
NumberFormatOptions

public static final class NumberFormatOptions.Builder extends Object
A simple builder for NumberFormatOptions.
Since:
8.2.2
  • Method Details

    • applyDefaultsIfMissing

      @CanIgnoreReturnValue public NumberFormatOptions.Builder applyDefaultsIfMissing()
      Apply the defaults for all options that are not set when building the options.
      Returns:
      This builder for chaining method calls.
    • applyDefaultsIfMissing

      @CanIgnoreReturnValue public NumberFormatOptions.Builder applyDefaultsIfMissing(boolean applyDefaultsIfMissing)
      When set to true, apply the defaults for all options that are not set when building the options.
      Parameters:
      applyDefaultsIfMissing - Whether to apply defaults for missing options.
      Returns:
      This builder for chaining method calls.
    • build

      public NumberFormatOptions build()
      Builds a new options instance. Subsequent modifications to this builder will not affect the returned instance.
      Returns:
      A new options instance.
    • changeValueOnWheel

      @CanIgnoreReturnValue public NumberFormatOptions.Builder changeValueOnWheel(boolean changeValueOnWheel)
      Sets whether to change the value when the mouse wheel is used. Defaults to false.
      Parameters:
      changeValueOnWheel - Whether to change the value on wheel.
      Returns:
      This builder for chaining method calls.
    • decimalPaddingMode

      @CanIgnoreReturnValue public NumberFormatOptions.Builder decimalPaddingMode(NumberFormatOptions.DecimalPaddingMode decimalPaddingMode)
      Whether to pad decimals with zeroes, up to the number of decimal places, see decimalPlaces(int).
      Parameters:
      decimalPaddingMode - The decimal padding mode.
      Returns:
      This builder for chaining method calls.
    • decimalPlaces

      @CanIgnoreReturnValue public NumberFormatOptions.Builder decimalPlaces(int decimalPlaces)
      Maximum number of decimal places to display, see also decimalPaddingMode(DecimalPaddingMode).
      Parameters:
      decimalPlaces - The number of decimal places.
      Returns:
      This builder for chaining method calls.
    • decimalSeparator

      @CanIgnoreReturnValue public NumberFormatOptions.Builder decimalSeparator(NumberFormatOptions.DecimalSeparator decimalSeparator)
      Separator to use to separate the integer part of the number from the fractional part.
      Parameters:
      decimalSeparator - The decimal separator to use.
      Returns:
      This builder for chaining method calls.
    • digitGroupMode

      @CanIgnoreReturnValue public NumberFormatOptions.Builder digitGroupMode(NumberFormatOptions.DigitGroupMode digitGroupMode)
      How to group digits in the integer part of the number.
      Parameters:
      digitGroupMode - The digit group mode.
      Returns:
      This builder for chaining method calls.
    • digitGroupSeparator

      @CanIgnoreReturnValue public NumberFormatOptions.Builder digitGroupSeparator(NumberFormatOptions.DigitGroupSeparator digitGroupSeparator)
      Separator to use between digit groups.
      Parameters:
      digitGroupSeparator - The digit group separator.
      Returns:
      This builder for chaining method calls.
    • emptyMode

      @CanIgnoreReturnValue public NumberFormatOptions.Builder emptyMode(NumberFormatOptions.EmptyMode emptyMode)
      Defines the behavior of the input field when it is empty.
      Parameters:
      emptyMode - The empty mode.
      Returns:
      This builder for chaining method calls.
    • itemProperties

      @CanIgnoreReturnValue public NumberFormatOptions.Builder itemProperties(IXItemPropertiesData itemProperties)
      Reads the number format options from the given item properties and sets them on this builder.
      Parameters:
      itemProperties - The item properties to read the options from.
      Returns:
      This builder for chaining method calls.
    • leadingZeroMode

      @CanIgnoreReturnValue public NumberFormatOptions.Builder leadingZeroMode(NumberFormatOptions.LeadingZeroMode leadingZeroMode)
      Defines how to treat leading zeroes, e.g. `003512`.
      Parameters:
      leadingZeroMode - The leading zero mode.
      Returns:
      This builder for chaining method calls.
    • negativeSign

      @CanIgnoreReturnValue public NumberFormatOptions.Builder negativeSign(char negativeSign)
      The sign used to indicate that a number is negative. Must be a single character. Must not be any of the numerical characters (digits).
      Parameters:
      negativeSign - The negative sign.
      Returns:
      This builder for chaining method calls.
    • positiveSign

      @CanIgnoreReturnValue public NumberFormatOptions.Builder positiveSign(char positiveSign)
      The sign used to indicate that a number is positive. Must be a single character. Must not be any of the numerical characters (digits).
      Parameters:
      positiveSign - The positive sign.
      Returns:
      This builder for chaining method calls.
    • roundingMode

      @CanIgnoreReturnValue public NumberFormatOptions.Builder roundingMode(NumberFormatOptions.RoundingMode roundingMode)
      The mode to use when rounding numbers.
      Parameters:
      roundingMode - The rounding mode.
      Returns:
      This builder for chaining method calls.
    • showPositiveSign

      @CanIgnoreReturnValue public NumberFormatOptions.Builder showPositiveSign()
      Show the positive sign for positive numbers.
      Returns:
      This builder for chaining method calls.
    • showPositiveSign

      @CanIgnoreReturnValue public NumberFormatOptions.Builder showPositiveSign(boolean showPositiveSign)
      Whether to show the positive sign for positive numbers.
      Parameters:
      showPositiveSign - Whether to show the positive sign.
      Returns:
      This builder for chaining method calls.
    • signumSignPlacement

      @CanIgnoreReturnValue public NumberFormatOptions.Builder signumSignPlacement(NumberFormatOptions.SignumSignPlacement signumSignPlacement)
      Where to place the signum sign that indicates whether a number is positive or negative. See also negative sign and positive sign.
      Parameters:
      signumSignPlacement - The signum sign placement.
      Returns:
      This builder for chaining method calls.
    • unitSign

      @CanIgnoreReturnValue public NumberFormatOptions.Builder unitSign(String unitSign)
      The unit sign to show before or after the number, see unitSignPlacement(UnitSignPlacement).
      Parameters:
      unitSign - The unit sign.
      Returns:
      This builder for chaining method calls.
    • unitSignPlacement

      @CanIgnoreReturnValue public NumberFormatOptions.Builder unitSignPlacement(NumberFormatOptions.UnitSignPlacement unitSignPlacement)
      Where to place the unit sign, if any.
      Parameters:
      unitSignPlacement - The unit sign placement.
      Returns:
      This builder for chaining method calls.
    • wheelStep

      @CanIgnoreReturnValue public NumberFormatOptions.Builder wheelStep(Double wheelStep)
      Sets the wheel step value as a string. When null, uses an automatic step based on the current settings and the current value. Applicable only if changeValueOnWheel is set to true.
      Parameters:
      wheelStep - The wheel step.
      Returns:
      This builder for chaining method calls.
    • wheelStep

      @CanIgnoreReturnValue public NumberFormatOptions.Builder wheelStep(double wheelStep)
      Sets the wheel step value as a string. When null, uses an automatic step based on the current settings and the current value. Applicable only if changeValueOnWheel is set to true.
      Parameters:
      wheelStep - The wheel step.
      Returns:
      This builder for chaining method calls.