Class CoercionHelper
- java.lang.Object
-
- org.hibernate.type.descriptor.java.CoercionHelper
-
public class CoercionHelper extends Object
Helper for type coercions. Mainly used for narrowing coercions which might lead to under/over-flow problems
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
CoercionHelper.Coercer<T>
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> T
coerceWrappingError(CoercionHelper.Coercer<T> coercer)
static boolean
isWholeNumber(double doubleValue)
static boolean
isWholeNumber(float floatValue)
static BigInteger
toBigInteger(Double doubleValue)
static BigInteger
toBigInteger(Float floatValue)
static BigInteger
toBigInteger(BigDecimal value)
static Byte
toByte(Double value)
static Byte
toByte(Float value)
static Byte
toByte(Integer value)
static Byte
toByte(Long value)
static Byte
toByte(Short value)
static Byte
toByte(BigDecimal value)
static Byte
toByte(BigInteger value)
static Double
toDouble(Float floatValue)
static Double
toDouble(BigDecimal value)
static Double
toDouble(BigInteger value)
static Integer
toInteger(Byte value)
static Integer
toInteger(Double doubleValue)
static Integer
toInteger(Float floatValue)
static Integer
toInteger(Long value)
static Integer
toInteger(Short value)
static Integer
toInteger(BigDecimal value)
static Integer
toInteger(BigInteger value)
static Long
toLong(Byte value)
static Long
toLong(Double doubleValue)
static Long
toLong(Float floatValue)
static Long
toLong(Integer value)
static Long
toLong(Short value)
static Long
toLong(BigDecimal value)
static Long
toLong(BigInteger value)
static Short
toShort(Byte value)
static Short
toShort(Double doubleValue)
static Short
toShort(Float floatValue)
static Short
toShort(Integer value)
static Short
toShort(Long value)
static Short
toShort(BigDecimal value)
static Short
toShort(BigInteger value)
-
-
-
Method Detail
-
toByte
public static Byte toByte(BigInteger value)
-
toByte
public static Byte toByte(BigDecimal value)
-
toShort
public static Short toShort(BigInteger value)
-
toShort
public static Short toShort(BigDecimal value)
-
toInteger
public static Integer toInteger(BigInteger value)
-
toInteger
public static Integer toInteger(BigDecimal value)
-
toLong
public static Long toLong(BigInteger value)
-
toLong
public static Long toLong(BigDecimal value)
-
toBigInteger
public static BigInteger toBigInteger(Double doubleValue)
-
toBigInteger
public static BigInteger toBigInteger(Float floatValue)
-
toBigInteger
public static BigInteger toBigInteger(BigDecimal value)
-
toDouble
public static Double toDouble(BigInteger value)
-
toDouble
public static Double toDouble(BigDecimal value)
-
isWholeNumber
public static boolean isWholeNumber(double doubleValue)
-
isWholeNumber
public static boolean isWholeNumber(float floatValue)
-
coerceWrappingError
public static <T> T coerceWrappingError(CoercionHelper.Coercer<T> coercer)
-
-