Class PrimitiveValueConverter
java.lang.Object
com.nomagic.magicdraw.uml2.datatypes.PrimitiveValueConverter
Converts value to specific primitive type.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringadjustDecimalSeparatorToSystem(String number) static DecimalFormatSymbolsGetsDecimalFormatSymbolsof OS.static Booleanstatic Booleanstatic Floatstatic Floatstatic Integerstatic Numberstatic Numberstatic Doublestatic 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
GetsDecimalFormatSymbolsof OS.DecimalFormatSymbolsis 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.
-