Contact Free trial Login

Types (dw::core::Types)

This module enables you to perform type introspection.

To use this module, you must import it to your DataWeave code, for example, by adding the line import * from dw::core::Types to the header of your DataWeave script.

Introduced in DataWeave 2.3.0. Supported by Mule 4.3 and later.

Functions

Name Description

arrayItem

Returns the type of the given array. This function fails if the input is not an Array type.

baseTypeOf

Returns an the base type of the given type.

functionParamTypes

Returns the list of parameters from the given function type. This function fails if the provided type is not a Function type.

functionReturnType

Returns the type of a function’s return type. This function fails if the input type is not a Function type.

intersectionItems

Returns an array of all the types that define a given Intersection type. This function fails if the input is not an Intersection type.

isAnyType

Returns true if the input is the Any type.

isArrayType

Returns true if the input type is the Array type.

isBinaryType

Returns true if the input is the Binary type.

isBooleanType

Returns true if the input is the Boolean type.

isDateTimeType

Returns true if the input is the DateTime type.

isDateType

Returns true if the input is the Date type.

isFunctionType

Returns true if the input is the Function type.

isIntersectionType

Returns true if the input type is the Intersection type.

isKeyType

Returns true if the input is the Key type.

isLiteralType

Returns true if the input is the Literal type.

isLocalDateTimeType

Returns true if the input is the LocalDateTime type.

isLocalTimeType

Returns true if the input is the LocalTime type.

isNamespaceType

Returns true if the input is the Namespace type.

isNothingType

Returns true if the input is the Nothing type.

isNullType

Returns true if the input is the Null type.

isNumberType

Returns true if the input is the Number type.

isObjectType

Returns true if the input is the Object type.

isPeriodType

Returns true if the input is the Period type.

isRangeType

Returns true if the input is the Range type.

isReferenceType

Returns true if the input type is a Reference type.

isRegexType

Returns true if the input is the Regex type.

isStringType

Returns true if the input is the String type.

isTimeType

Returns true if the input is the Time type.

isTimeZoneType

Returns true if the input is the TimeZone type.

isTypeType

Returns true if the input is the Type type.

isUnionType

Returns true if the input type is the Union type.

isUriType

Returns true if the input is the Uri type.

literalValueOf

Returns the value of an input belongs to the Literal type.

metadataOf

Returns metadata that is attached to the given type.

nameOf

Returns the name of the input type.

objectFields

Returns the array of fields from the given Object type. This function fails if the type is not an Object type.

unionItems

Returns an array of all the types that define a given Union type. This function fails if the input is not a Union type.

Types

Was this article helpful?

💙 Thanks for your feedback!

Edit on GitHub