Package de.uplanet.lucy.types
Class Cast
java.lang.Object
de.uplanet.lucy.types.Cast
-
Method Summary
Modifier and TypeMethodDescriptionstatic BigDecimal
toBigDecimal
(Number p_value) This method callstoBigDecimal(Number, MathContext)
with aMathContext.UNLIMITED
as math context.static BigDecimal
toBigDecimal
(Number p_value, MathContext p_mathContext) Cast the given number tojava.math.BigDecimal
.static boolean
Cast an integral number with value in{0, 1}
toboolean
.static byte
static double
static float
static int
static long
static short
-
Method Details
-
toBoolean
Cast an integral number with value in{0, 1}
toboolean
.- Parameters:
p_value
- The integral number.- Returns:
true
if the given value is1
, orfalse
if the given value is0
.- Throws:
IllegalArgumentException
- Ifp_value
isnull
, or not of an integral data type.ArithmeticException
- If the given value is not in{0, 1}
.
-
toByte
-
toShort
-
toInt
-
toLong
-
toFloat
-
toDouble
-
toBigDecimal
This method callstoBigDecimal(Number, MathContext)
with aMathContext.UNLIMITED
as math context.- Parameters:
p_value
- The number.- Returns:
- The given number cast to
java.math.BigDecimal
. - Throws:
IllegalArgumentException
- Ifp_value
isnull
.
-
toBigDecimal
Cast the given number tojava.math.BigDecimal
.- Parameters:
p_value
- The number.p_mathContext
- The math context to be used.- Returns:
- The given number cast to
java.math.BigDecimal
. - Throws:
IllegalArgumentException
- Ifp_value
isnull
.
-