I have a property ( String
, obviously), expressed in minutes, that I want to convert to int
before I do some arithmetic and inject it into my Spring bean. Right now I have this SpEL expression:
#{T(java.lang.Integer).parseInt(myProperties['MIN_TIME']) * 60 * 1000}
where myProperties
is a simple java.util.Properties
bean.
Not that I was particularly annoyed by this expression, but nonetheless: Does SpEL have a more beautiful, built-in way to parse strings into numerical values?
Thanks!
source share