Class NumberFormatOptions
- java.lang.Object
-
- de.xima.fc.form.common.number_format.NumberFormatOptions
-
public class NumberFormatOptions extends Object
Model class for the options used by our client-side $.xutil.numberFormat wrapper.- Since:
- 8.2.2
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
NumberFormatOptions.Builder
A simple builder forNumberFormatOptions
.static class
NumberFormatOptions.DecimalPaddingMode
Whether to pad decimals with zeroes, up to the number of decimal places.static class
NumberFormatOptions.DecimalSeparator
Separator to use to separate the integer part of the number from the fractional part.static class
NumberFormatOptions.DigitGroupMode
How to group digits in the integer part of the number.static class
NumberFormatOptions.DigitGroupSeparator
Separator to use between digit groups.static class
NumberFormatOptions.EmptyMode
Defines the behavior of the input field when it is empty, i.e.static class
NumberFormatOptions.LeadingZeroMode
Defines how to treat leading zeroes, e.g.static class
NumberFormatOptions.RoundingMode
The mode to use when rounding numbers.static class
NumberFormatOptions.SignumSignPlacement
Where to place the signum sign that indicates whether a number is positive or negative.static class
NumberFormatOptions.UnitSignPlacement
Where to place the unit sign, if any.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static NumberFormatOptions.Builder
builder()
Creates a new builder forNumberFormatOptions
.static NumberFormatOptions.Builder
builderWithDefaults()
Creates a new builder forNumberFormatOptions
that applies the defaults to all options that are not set.NumberFormatOptions.DecimalPaddingMode
decimalPaddingMode()
Whether to pad decimals with zeroes, up to the number of decimal places, seedecimalPlaces()
.Integer
decimalPlaces()
Maximum number of decimal places to display, see alsodecimalPaddingMode()
.NumberFormatOptions.DecimalSeparator
decimalSeparator()
Separator to use to separate the integer part of the number from the fractional part.static NumberFormatOptions
defaults()
Creates a new options instance with default values.NumberFormatOptions.DigitGroupMode
digitGroupMode()
How to group digits in the integer part of the number.NumberFormatOptions.DigitGroupSeparator
digitGroupSeparator()
Separator to use between digit groups.NumberFormatOptions.EmptyMode
emptyMode()
Defines the behavior of the input field when it is empty.boolean
equals(Object o)
int
hashCode()
NumberFormatOptions.LeadingZeroMode
leadingZeroMode()
Defines how to treat leading zeroes, e.g.Character
negativeSign()
The sign used to indicate that a number is negative.Character
positiveSign()
The sign used to indicate that a number is positive.NumberFormatOptions.RoundingMode
roundingMode()
The mode to use when rounding numbers.Boolean
showPositiveSign()
Whether to show the positive sign for positive numbers.NumberFormatOptions.SignumSignPlacement
signumSignPlacement()
Where to place the signum sign that indicates whether a number is positive or negative.NumberFormatOptions.Builder
toBuilder()
Creates a new builder initialized with the values of this options instance.com.alibaba.fastjson.JSONObject
toJsonObject()
Converts this options instance to a JSON object that can be used by the client.String
unitSign()
The unit sign to show before or after the number, seeunit sign placement
.NumberFormatOptions.UnitSignPlacement
unitSignPlacement()
Where to place theunit sign
, if any.
-
-
-
Method Detail
-
decimalPaddingMode
public NumberFormatOptions.DecimalPaddingMode decimalPaddingMode()
Whether to pad decimals with zeroes, up to the number of decimal places, seedecimalPlaces()
.- Returns:
- The decimal padding mode.
-
decimalPlaces
public Integer decimalPlaces()
Maximum number of decimal places to display, see alsodecimalPaddingMode()
.- Returns:
- The number of decimal places.
-
decimalSeparator
public NumberFormatOptions.DecimalSeparator decimalSeparator()
Separator to use to separate the integer part of the number from the fractional part.- Returns:
- The decimal separator to use.
-
digitGroupMode
public NumberFormatOptions.DigitGroupMode digitGroupMode()
How to group digits in the integer part of the number.- Returns:
- The digit group mode.
-
digitGroupSeparator
public NumberFormatOptions.DigitGroupSeparator digitGroupSeparator()
Separator to use between digit groups.- Returns:
- The digit group separator.
-
emptyMode
public NumberFormatOptions.EmptyMode emptyMode()
Defines the behavior of the input field when it is empty.- Returns:
- The empty mode.
-
leadingZeroMode
public NumberFormatOptions.LeadingZeroMode leadingZeroMode()
Defines how to treat leading zeroes, e.g. `003512`.- Returns:
- The leading zero mode.
-
negativeSign
public Character 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).- Returns:
- The negative sign.
-
positiveSign
public Character 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).- Returns:
- The positive sign.
-
roundingMode
public NumberFormatOptions.RoundingMode roundingMode()
The mode to use when rounding numbers.- Returns:
- The rounding mode.
-
showPositiveSign
public Boolean showPositiveSign()
Whether to show the positive sign for positive numbers.- Returns:
- Whether to show the positive sign.
-
signumSignPlacement
public NumberFormatOptions.SignumSignPlacement signumSignPlacement()
Where to place the signum sign that indicates whether a number is positive or negative. See alsonegative sign
andpositive sign
.- Returns:
- The signum sign placement.
-
toBuilder
public NumberFormatOptions.Builder toBuilder()
Creates a new builder initialized with the values of this options instance.- Returns:
- A new builder initialized with the values of this options instance.
-
toJsonObject
public com.alibaba.fastjson.JSONObject toJsonObject()
Converts this options instance to a JSON object that can be used by the client.- Returns:
- A JSON object representing this options instance.
-
unitSign
public String unitSign()
The unit sign to show before or after the number, seeunit sign placement
.- Returns:
- The unit sign.
-
unitSignPlacement
public NumberFormatOptions.UnitSignPlacement unitSignPlacement()
Where to place theunit sign
, if any.- Returns:
- The unit sign placement.
-
builder
public static NumberFormatOptions.Builder builder()
Creates a new builder forNumberFormatOptions
.- Returns:
- A new builder for
NumberFormatOptions
.
-
builderWithDefaults
public static NumberFormatOptions.Builder builderWithDefaults()
Creates a new builder forNumberFormatOptions
that applies the defaults to all options that are not set.- Returns:
- A new builder for
NumberFormatOptions
.
-
defaults
public static NumberFormatOptions defaults()
Creates a new options instance with default values.- Returns:
- A new options instance with default values.
-
-