Class PrimitiveValueConverter
- java.lang.Object
-
- com.nomagic.magicdraw.uml2.datatypes.PrimitiveValueConverter
-
public class PrimitiveValueConverter extends java.lang.Object
Converts value to specific primitive type.
-
-
Constructor Summary
Constructors Constructor Description PrimitiveValueConverter()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
adjustDecimalSeparatorToSystem(java.lang.String number)
static java.text.DecimalFormat
getDecimalFormat()
static java.text.DecimalFormatSymbols
getDecimalFormatSymbols()
static java.lang.Boolean
toBoolean(java.lang.Object value, java.lang.Boolean defaultValue)
static java.lang.Boolean
toBoolean(java.lang.Object value, java.lang.Boolean defaultValue, java.util.function.Function<java.lang.Object,java.lang.Boolean> converter)
static java.lang.Float
toFloat(java.lang.Object value)
static java.lang.Float
toFloat(java.lang.Object value, java.lang.Float defaultValue)
static java.lang.Integer
toInteger(java.lang.Object value, java.lang.Integer defaultValue)
static java.lang.Number
toNumber(java.lang.Object value)
static java.lang.Number
toNumber(java.lang.Object value, Type type)
static java.lang.Double
toReal(java.lang.Object value)
static java.lang.Double
toReal(java.lang.Object value, java.lang.Double defaultValue)
-
-
-
Method Detail
-
toBoolean
@CheckForNull public static java.lang.Boolean toBoolean(@CheckForNull java.lang.Object value, @CheckForNull java.lang.Boolean defaultValue)
-
toBoolean
@CheckForNull public static java.lang.Boolean toBoolean(@CheckForNull java.lang.Object value, @CheckForNull java.lang.Boolean defaultValue, java.util.function.Function<java.lang.Object,java.lang.Boolean> converter)
-
toReal
@CheckForNull public static java.lang.Double toReal(java.lang.Object value) throws java.lang.NumberFormatException
- Throws:
java.lang.NumberFormatException
-
toReal
@CheckForNull public static java.lang.Double toReal(@CheckForNull java.lang.Object value, @CheckForNull java.lang.Double defaultValue) throws java.lang.NumberFormatException
- Throws:
java.lang.NumberFormatException
-
toFloat
public static java.lang.Float toFloat(java.lang.Object value) throws java.lang.NumberFormatException
- Throws:
java.lang.NumberFormatException
-
toFloat
@CheckForNull public static java.lang.Float toFloat(@CheckForNull java.lang.Object value, @CheckForNull java.lang.Float defaultValue) throws java.lang.NumberFormatException
- Throws:
java.lang.NumberFormatException
-
toInteger
@CheckForNull public static java.lang.Integer toInteger(@CheckForNull java.lang.Object value, @CheckForNull java.lang.Integer defaultValue) throws java.lang.NumberFormatException
- Throws:
java.lang.NumberFormatException
-
toNumber
@CheckForNull public static java.lang.Number toNumber(java.lang.Object value, Type type)
-
toNumber
public static java.lang.Number toNumber(java.lang.Object value) throws java.lang.NumberFormatException
- Throws:
java.lang.NumberFormatException
-
adjustDecimalSeparatorToSystem
public static java.lang.String adjustDecimalSeparatorToSystem(java.lang.String number)
-
getDecimalFormat
public static java.text.DecimalFormat getDecimalFormat()
-
getDecimalFormatSymbols
public static java.text.DecimalFormatSymbols getDecimalFormatSymbols()
-
-