O'Reilly logo

Talend Open Studio Cookbook by Rick Barton

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Appendix A. Common Type Conversions

The following table is a set of Java and Talend methods that allow conversion between different data types. This is by no means an exhaustive list, but will cover many of type conversions that you will encounter.

From Type

To Type

Example

String

Integer

Integer.parseInt(row1.myString)

String

Date

TalendDate.parseDate("dd-MM-yyyy",row1.myString)

String

BigDecimal

new BigDecimal(row1.myString) where myString can include decimal places. For example, 99.00

String

Float

Float.parseFloat(row1.myString)

String

Long

Long.parseLong(row1.myString)

Integer

String

variable+"" or variable.toString()

Date

String

TalendDate.formatDate("yy-MM-dd", row1.myDate)

BigDecimal

String

row1.myBigDecimal.toString() ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required