Contact Us 1-800-596-4880

isReferenceType

isReferenceType(t: Type): Boolean

Returns true if the input type is a Reference type.

Introduced in DataWeave version 2.3.0.

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
}