intersectionItems

intersectionItems(Type): Array<Type>

特定の Intersection (交差) 型を定義するすべての型の配列を返します。 入力が Intersection (交差) 型でない場合、この関数は失敗します。

DataWeave 2.3.0 で導入されました。Mule 4.3 以降でサポートされます。

パラメーター

名前 説明

t

チェックするデータ型。

次の例では、さまざまな入力での ​intersectionItems​ の動作を示します。 AType​ 変数は、2 つのオブジェクト間の ​&​ を使用して Intersection (交差) 型 ​{name: String} & {age: Number}​ を定義します。

ソース

%dw 2.0
import * from dw::core::Types
type AType = {name: String} & {age: Number}
output application/json
---
{
   a: intersectionItems(AType)
}

出力

{
  "a": ["Object","Object"]
}