Core Types (dw::Core) | MuleSoft Documentation
# Core Types (dw::Core)
Type | Definition | Description  
---|---|---  
`type Any = Any` |  The top-level type. `Any` extends all of the system types, which means that anything can be assigned to a `Any` typed variable.  
`type Array = Array` |  Array type that requires a `Type(T)` to represent the elements of the list. Example: `Array<Number>` represents an array of numbers, and `Array<Any>` represents an array of any type. Example: `[1, 2, "a", "b", true, false, { a : "b"}, [1, 2, 3] ]`  
`type Binary = Binary`  
`type Boolean = Boolean` |  A `Boolean` type of `true` or `false`.  
`type CData = String {cdata: true}` |  XML defines a `CData` custom type that extends from `String` and is used to identify a CDATA XML block. It can be used to tell the writer to wrap the content inside CDATA or to check if the string arrives inside a CDATA block. `CData` inherits from the type `String`. `output application/xml --- { "user" : "Shoki" as CData }` `<?xml version="1.0" encoding="UTF-8"?><user><![CDATA[Shoki]]></user>`  
Comparable |  `type Comparable = String | Number | Boolean | DateTime | LocalDateTime | Date | LocalTime | Time | TimeZone` |  A union type that represents all the types that can be compared to each other.  
`type Date = Date` |  A date represented by a year, month, and day. For example: `|2018-09-17|`  
DateTime |  `type DateTime = DateTime` |  A `Date` and `Time` within a `TimeZone`. For example: `|2018-09-17T22:13:00Z|`  
Dictionary |  `type Dictionary = { _?: T }` |  Generic dictionary interface.  
`type Enum = String {enumeration: true}` |  This type is based on the Enum Java class. It must always be used with the `class` property, specifying the full Java class name of the class, as shown in the example below. `"Max" as Enum {class: "com.acme.MuleyEnum"}`  
Iterator |  `type Iterator = Array {iterator: true}` |  This type is based on the iterator Java class. The iterator contains a collection and includes methods to iterate through and filter it. Just like the Java class, `Iterator` is designed to be consumed only once. For example, if you pass it to a Logger component, the Logger consumes it, so it becomes unreadable by further elements in the flow.  
`type Key = Key` |  A key of an `Object`. Examples: `{ myKey : "a value" }`, `{ myKey : { a : 1, b : 2} }`, `{ myKey : [1,2,3,4] }`  
LocalDateTime |  `type LocalDateTime = LocalDateTime` |  A `DateTime` in the current `TimeZone`. For example: `|2018-09-17T22:13:00|`  
LocalTime |  `type LocalTime = LocalTime` |  A `Time` in the current `TimeZone`. For example: `|22:10:18|`  
`type NaN = Null {NaN: true}` |  `java.lang.Float` and `java.lang.Double` have special cases for `NaN` and `Infinit`. DataWeave does not have these concepts for its number multi-precision nature. So when it is mapped to DataWeave values, it is wrapped in a Null with a Schema marker.  
Namespace |  `type Namespace = Namespace` |  A `Namespace` type represented by a `URI` and a prefix.  
`type Nothing = Nothing` |  Bottom type. This type can be assigned to all the types.  
`type Null = Null` |  A Null type, which represents the `null` value.  
`type Number = Number` |  A number type: Any number, decimal, or integer is represented by the Number` type.  
`type Object = Object` |  Type that represents any object, which is a collection of `Key` and value pairs. Examples: `{ myKey : "a value" }`, `{ myKey : { a : 1, b : 2} }`, `{ myKey : [1,2,3,4] }`  
`type Pair = { l: LEFT, r: RIGHT }` |  A type used to represent a pair of values. _Introduced in DataWeave version 2.2.0._  
`type Period = Period`  
`type Range = Range` |  A `Range` type represents a sequence of numbers.  
`type Regex = Regex` |  A Java regular expression (regex) type.  
`type Result = { success: true, result: T } | { success: false, error: E }` |  A type for representing an execution result. Supports the following fields:
  * `success`: Determine if the execution ends successfully. If `true`, the data type provides the `result`. If `false`, the data type provides the `error`.
  * `result`: The success result data.
  * `error`: The error data.

_Introduced in DataWeave version 2.7.0._  
SimpleType |  `type SimpleType = String | Boolean | Number | DateTime | LocalDateTime | Date | LocalTime | Time | TimeZone | Period` |  A union type that represents all the simple types.  
`type String = String`  
StringCoerceable |  `type StringCoerceable = String | Boolean | Number | DateTime | LocalDateTime | Date | LocalTime | Time | TimeZone | Period | Key | Binary | Uri | Type<Any> | Regex | Namespace` |  A union type of all the types that can be coerced to String type. _Introduced in DataWeave version 2.3.0._  
`type Time = Time` |  A time in a specific `TimeZone`. For example: `|22:10:18Z|`  
TimeZone |  `type TimeZone = TimeZone` |  A time zone.  
`type Type = Type` |  A type in the DataWeave type system.  
`type Uri = Uri`