Package one.microstream.typing
Class XTypes
java.lang.Object
one.microstream.typing.XTypes
public final class XTypes extends Object
Collection of generic util logic missing or too complicated in JDK API.
-
Method Summary
Modifier and Type Method Description static Byte
asByte(Number value)
static Double
asDouble(Number value)
static Float
asFloat(Number value)
static Integer
asInteger(Number value)
static Long
asLong(Number value)
static Short
asShort(Number value)
static TypeMapping<Float>
createDefaultTypeSimilarity()
static Class<?>
directByteBufferClass()
static ByteBuffer
guaranteeDirectByteBuffer(ByteBuffer directBuffer)
static boolean
isBoolean(Object o)
static boolean
isBooleanType(Class<?> c)
static boolean
isByteType(Class<?> c)
static boolean
isCharacterType(Class<?> c)
static boolean
isCharSequenceType(Class<?> c)
static boolean
isDecimal(Object o)
static boolean
isDecimalType(Class<?> c)
static boolean
isDirectByteBuffer(ByteBuffer byteBuffer)
static boolean
isDoubleType(Class<?> c)
static boolean
isFloatType(Class<?> c)
static boolean
isIntegerType(Class<?> c)
static boolean
isLiteral(Object o)
static boolean
isLiteralType(Class<?> c)
static boolean
isLongType(Class<?> c)
static boolean
isNaturalNumber(Object o)
static boolean
isNaturalNumberType(Class<?> c)
static boolean
isNumber(Object o)
static boolean
isNumberType(Class<?> c)
static boolean
isPrimitiveWrapper(Object o)
static boolean
isShortType(Class<?> c)
static boolean
isStringType(Class<?> c)
static boolean
isValueType(Class<?> c)
static boolean
isValueType(Object o)
Checks if the type of the passed instance is an immutable special value type of the java language.static boolean
to_boolean(byte value)
static byte
to_byte(boolean value)
static int
to_int(boolean value)
static int
to_int(double value)
static int
to_int(float value)
static int
to_int(long value)
static int
to_int(Number value)
-
Method Details
-
directByteBufferClass
-
isDirectByteBuffer
-
guaranteeDirectByteBuffer
-
isBooleanType
-
isByteType
-
isShortType
-
isIntegerType
-
isLongType
-
isFloatType
-
isDoubleType
-
isCharacterType
-
isStringType
-
isCharSequenceType
-
isNaturalNumberType
-
isDecimalType
-
isNumberType
-
isLiteralType
-
isValueType
-
isNaturalNumber
-
isNumber
-
isDecimal
-
isLiteral
-
isBoolean
-
isValueType
Checks if the type of the passed instance is an immutable special value type of the java language. This includes all primitive wrappers andString
.- Parameters:
o
- the instance to be checked- Returns:
true
if the type of the passed instance is an immutable special value type.
-
isPrimitiveWrapper
-
to_byte
public static final byte to_byte(boolean value) -
to_boolean
public static final boolean to_boolean(byte value) -
to_int
public static final int to_int(boolean value) -
to_int
- Throws:
NumberRangeException
-
to_int
- Throws:
NumberRangeException
-
to_int
- Throws:
NumberRangeException
-
to_int
-
asByte
-
asShort
-
asInteger
-
asFloat
-
asLong
-
asDouble
-
createDefaultTypeSimilarity
-