isCastable
Returns true if the input value can be converted to a given data type.
Information noteNote: This feature is only available in
Talend Data Mapper.
Arguments
- Input value.
- String containing the name of a data type. The following values are supported:
- BigDecimal
- Decimal or Dec
- Bytes
- DateTime
- Date
- Time
- Integer or Int
- Long
- Float
- Double
- String
- Boolean or Bool
- Null
These values are case-insensitive.
Examples
Expression | Result |
---|---|
isCastable("Hello World", "bool") | true |
isCastable("Hello World", "INTEGER") | false |