Module com.github.rvesse.airline
Class ComplexNumericTypeConverter
java.lang.Object
com.github.rvesse.airline.types.numerics.DefaultNumericConverter
com.github.rvesse.airline.types.numerics.ComplexNumericTypeConverter
- All Implemented Interfaces:
NumericTypeConverter
,TypeConverterProvider
- Direct Known Subclasses:
AbbreviatedNumericTypeConverter
,Binary
,Hexadecimal
,Octal
Abstract numeric type converter that supports numerics given in the form
1234suffix
where suffix
denotes some multiplier. For example
1234k
might treat k
as a multiplier of 1000
. Derived
implementations should be created to provide the set of supported suffixes
and their multipliers.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected BigDecimal
getBigDecimal
(NumericCandidate candidate) protected BigInteger
getBigInteger
(NumericCandidate candidate) protected Double
getDouble
(NumericCandidate candidate) protected Float
getFloat
(NumericCandidate candidate) protected Long
getLong
(NumericCandidate candidate) protected long
getMultiplier
(NumericCandidate candidate) protected int
getRadix
(NumericCandidate candidate) protected NumericCandidate
protected ConvertResult
tryConvertBigDecimal
(String name, String value) protected ConvertResult
tryConvertBigInteger
(String name, String value) protected ConvertResult
tryConvertByte
(String name, String value) protected ConvertResult
tryConvertDouble
(String name, String value) protected ConvertResult
tryConvertFloat
(String name, String value) protected ConvertResult
tryConvertInteger
(String name, String value) protected ConvertResult
tryConvertLong
(String name, String value) protected ConvertResult
tryConvertShort
(String name, String value) Methods inherited from class com.github.rvesse.airline.types.numerics.DefaultNumericConverter
getTypeConverter, getTypeConverter, tryConvertNumerics
-
Constructor Details
-
ComplexNumericTypeConverter
public ComplexNumericTypeConverter()
-
-
Method Details
-
parse
-
getBigDecimal
-
getBigInteger
-
getLong
-
getDouble
-
getFloat
-
getMultiplier
-
getRadix
-
tryConvertBigDecimal
- Overrides:
tryConvertBigDecimal
in classDefaultNumericConverter
-
tryConvertDouble
- Overrides:
tryConvertDouble
in classDefaultNumericConverter
-
tryConvertFloat
- Overrides:
tryConvertFloat
in classDefaultNumericConverter
-
tryConvertBigInteger
- Overrides:
tryConvertBigInteger
in classDefaultNumericConverter
-
tryConvertLong
- Overrides:
tryConvertLong
in classDefaultNumericConverter
-
tryConvertInteger
- Overrides:
tryConvertInteger
in classDefaultNumericConverter
-
tryConvertShort
- Overrides:
tryConvertShort
in classDefaultNumericConverter
-
tryConvertByte
- Overrides:
tryConvertByte
in classDefaultNumericConverter
-