Contact Free trial Login

isReferenceType

isReferenceType(Type): Boolean

Returns true if the input type is a Reference type.

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

Parameters

Name Description

t

The type to check.

Example

This example shows how isReferenceType behaves with different inputs.

Source

%dw 2.0
output application/json
import * from dw::core::Types
 type AArray = Array<String> {n: 1}
 type AArray2 = Array<AArray>
 ---
 {
     a: isReferenceType( AArray),
     b: isReferenceType(arrayItem(AArray2)),
     c: isReferenceType(String)
 }

Output

{
  "a": false,
  "b": true,
  "c": false
}

Was this article helpful?

💙 Thanks for your feedback!

Edit on GitHub