cast long to integer in tMap

One Star

cast long to integer in tMap

How would I cast a long to an integer in a tMap? (ignoring the possibilities of overflows)
Looking at http://www.talendforge.org/forum/viewtopic.php?id=16407, I tried this:
new Integer(order_lines.order_id) as my expression, but got an error "The constructor Integer(long) is undefined".
I also looked at http://www.talendforge.org/forum/viewtopic.php?id=10783 (string -> int -> date) and http://www.talendforge.org/forum/viewtopic.php?id=29945 (string -> int), and many Stack Overflow topics
Java is YALTL (Yet Another Language To Learn) for me... Thanks, Sonia.
Five Stars

Re: cast long to integer in tMap

If it's an Object, you could use mylnteger.intValue().
As you say, ignoring the fact that the value may be too large
One Star

Re: cast long to integer in tMap

Thanks I'll give that a go.
PS I like your "ByExample" site.
One Star

Re: cast long to integer in tMap

If it's an Object, you could use mylnteger.intValue().
As you say, ignoring the fact that the value may be too large

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.

Download