Class XTypes


  • public final class XTypes
    extends Object
    Collection of generic util logic missing or too complicated in JDK API.
    • Constructor Detail

      • XTypes

        public XTypes()
    • Method Detail

      • directByteBufferClass

        public static final Class<?> directByteBufferClass()
      • isDirectByteBuffer

        public static final boolean isDirectByteBuffer​(ByteBuffer byteBuffer)
      • guaranteeDirectByteBuffer

        public static final ByteBuffer guaranteeDirectByteBuffer​(ByteBuffer directBuffer)
      • isBooleanType

        public static boolean isBooleanType​(Class<?> c)
      • isByteType

        public static boolean isByteType​(Class<?> c)
      • isShortType

        public static boolean isShortType​(Class<?> c)
      • isIntegerType

        public static boolean isIntegerType​(Class<?> c)
      • isLongType

        public static boolean isLongType​(Class<?> c)
      • isFloatType

        public static boolean isFloatType​(Class<?> c)
      • isDoubleType

        public static boolean isDoubleType​(Class<?> c)
      • isCharacterType

        public static boolean isCharacterType​(Class<?> c)
      • isStringType

        public static boolean isStringType​(Class<?> c)
      • isCharSequenceType

        public static boolean isCharSequenceType​(Class<?> c)
      • isNaturalNumberType

        public static boolean isNaturalNumberType​(Class<?> c)
      • isDecimalType

        public static boolean isDecimalType​(Class<?> c)
      • isNumberType

        public static boolean isNumberType​(Class<?> c)
      • isLiteralType

        public static boolean isLiteralType​(Class<?> c)
      • isValueType

        public static boolean isValueType​(Class<?> c)
      • isNaturalNumber

        public static boolean isNaturalNumber​(Object o)
      • isNumber

        public static boolean isNumber​(Object o)
      • isDecimal

        public static boolean isDecimal​(Object o)
      • isLiteral

        public static boolean isLiteral​(Object o)
      • isBoolean

        public static boolean isBoolean​(Object o)
      • isValueType

        public static boolean isValueType​(Object o)
        Checks if the type of the passed instance is an immutable special value type of the java language. This includes all primitive wrappers and String.
        Parameters:
        o - the instance to be checked
        Returns:
        true if the type of the passed instance is an immutable special value type.
      • isPrimitiveWrapper

        public static boolean isPrimitiveWrapper​(Object o)
      • 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)
      • asByte

        public static final Byte asByte​(Number value)
      • asShort

        public static final Short asShort​(Number value)
      • asInteger

        public static final Integer asInteger​(Number value)
      • asFloat

        public static final Float asFloat​(Number value)
      • asLong

        public static final Long asLong​(Number value)
      • asDouble

        public static final Double asDouble​(Number value)
      • createDefaultTypeSimilarity

        public static final TypeMapping<Float> createDefaultTypeSimilarity()