Package software.amazon.jsii
Class NativeType<T>
java.lang.Object
software.amazon.jsii.NativeType<T>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final com.fasterxml.jackson.databind.JavaType[]static final NativeType<Void>ANativeTyperepresentation for `void`. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedNativeType(com.fasterxml.jackson.databind.JavaType javaType) -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> NativeType<T>static <T> NativeType<T>Creates aNativeTypefor the given Java type description.static <T> NativeType<List<T>>listOf(NativeType<T> elementType) static <T> NativeType<Map<String,T>> mapOf(NativeType<T> elementType)
-
Field Details
-
NO_TYPE_PARAMS
protected static final com.fasterxml.jackson.databind.JavaType[] NO_TYPE_PARAMS -
VOID
ANativeTyperepresentation for `void`.
-
-
Constructor Details
-
NativeType
protected NativeType(com.fasterxml.jackson.databind.JavaType javaType)
-
-
Method Details
-
forClass
- Type Parameters:
T- the static type ofsimpleType.- Parameters:
simpleType- the Java class to be represented.- Returns:
- a new
NativeTypeinstance. - Throws:
IllegalArgumentException- if aListorMapsubclass is passed as an argument.
-
listOf
- Type Parameters:
T- the static type of the elements in theList.- Parameters:
elementType- the type of elements in theList.- Returns:
- a new
NativeTypeinstance.
-
mapOf
- Type Parameters:
T- the static type of the values in theMap.- Parameters:
elementType- the type of values in theMap.- Returns:
- a new
NativeTypeinstance.
-
forType
Creates aNativeTypefor the given Java type description. This particular API is unsafe and should not be used if any of the other APIs can be.- Type Parameters:
T- the static type of the represented type. This operation is not checked, leaving the caller responsible for ensuring the correct type is specified.- Parameters:
type- theTypeto be represented. It can be any type, including aClassreference, however when aClassinstance is available, the caller should useforClass(Class),listOf(NativeType)andmapOf(NativeType)appropriately instead, as this operation is not checked at runtime.- Returns:
- a new
NativeTypeinstance.
-