Long type from java is not working with velocity if condition
I am using velocity engine for email with Java where one of the variables type is Long. While trying if condition on that variable it never succeeds.
Tried following ways but none was helpful,
#if($customTypeList.LongTypeId == 1)
#if($customTypeList.LongTypeId == '1')
#if($customTypeList.LongTypeId == "1")
It should go inside the if condition as variables value is 1. I have validated that with sysout and even by printing in template.
Actually got the answer after number of trials... Posting to help others.
#if($customTypeList.longTypeId.intValue() == 1)