Class NativeTypes

  • public class NativeTypes
    extends Object
    Provides functionality around the Java primitive data types and their wrapper types. They are considered native.
    Gunnar Morling
    • Method Detail

      • getWrapperType

        public static Class<?> getWrapperType​(Class<?> clazz)
      • getPrimitiveType

        public static Class<?> getPrimitiveType​(Class<?> clazz)
      • isNative

        public static boolean isNative​(String fullyQualifiedName)
      • isNumber

        public static boolean isNumber​(Class<?> clazz)
      • getLiteral

        public static Class<?> getLiteral​(String className,
                                          String literal)
        className - FQN of the literal native class
        literal - literal to verify
        literal class when the literal is a proper literal for the provided kind.
        IllegalArgumentException - when the literal does not match to the provided native type className
      • getName

        public static String getName​(TypeKind typeKind)
        The name that should be used for the typeKind. Should be used in order to get the name of a primitive type
        typeKind - the type kind
        the name that should be used for the typeKind
      • isNarrowing

        public static boolean isNarrowing​(String sourceFQN,
                                          String targetFQN)