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.
3 REPLIES
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