Package org.mapstruct.ap.internal.util
Class NativeTypes
- java.lang.Object
-
- org.mapstruct.ap.internal.util.NativeTypes
-
public class NativeTypes extends Object
Provides functionality around the Java primitive data types and their wrapper types. They are considered native.- Author:
- Gunnar Morling
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Class<?>getLiteral(String className, String literal)static StringgetName(TypeKind typeKind)The name that should be used for thetypeKind.static Class<?>getPrimitiveType(Class<?> clazz)static Class<?>getWrapperType(Class<?> clazz)static booleanisNarrowing(String sourceFQN, String targetFQN)static booleanisNative(String fullyQualifiedName)static booleanisNumber(Class<?> clazz)
-
-
-
Method Detail
-
isNative
public static boolean isNative(String fullyQualifiedName)
-
isNumber
public static boolean isNumber(Class<?> clazz)
-
getLiteral
public static Class<?> getLiteral(String className, String literal)
- Parameters:
className- FQN of the literal native classliteral- literal to verify- Returns:
- literal class when the literal is a proper literal for the provided kind.
- Throws:
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 thetypeKind. Should be used in order to get the name of a primitive type- Parameters:
typeKind- the type kind- Returns:
- the name that should be used for the
typeKind
-
-