Class PrimitiveValueConverter
java.lang.Object
com.nomagic.magicdraw.uml2.datatypes.PrimitiveValueConverter
Converts value to specific primitive type.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
adjustDecimalSeparatorToSystem
(String number) static DecimalFormatSymbols
GetsDecimalFormatSymbols
of OS.static Boolean
static Boolean
static Float
static Float
static Integer
static Number
static Number
static Double
static Double
-
Constructor Details
-
PrimitiveValueConverter
public PrimitiveValueConverter()
-
-
Method Details
-
toBoolean
-
toBoolean
-
toReal
- Throws:
NumberFormatException
-
toReal
@CheckForNull public static Double toReal(@CheckForNull Object value, @CheckForNull Double defaultValue) throws NumberFormatException - Throws:
NumberFormatException
-
toFloat
- Throws:
NumberFormatException
-
toFloat
@CheckForNull public static Float toFloat(@CheckForNull Object value, @CheckForNull Float defaultValue) throws NumberFormatException - Throws:
NumberFormatException
-
toInteger
@CheckForNull public static Integer toInteger(@CheckForNull Object value, @CheckForNull Integer defaultValue) throws NumberFormatException - Throws:
NumberFormatException
-
toNumber
-
toNumber
- Throws:
NumberFormatException
-
adjustDecimalSeparatorToSystem
-
getDecimalFormatSymbols
GetsDecimalFormatSymbols
of OS.DecimalFormatSymbols
is get on separate process because HOST locale provider should be used to get OS specific data, but the tool uses different one.- Returns:
- OS DecimalFormatSymbols configuration.
-