longvalueobjects
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| longvalueobjects [2021/10/12 14:42] – created wikiadmin | longvalueobjects [2021/10/12 17:12] (current) – [Storing a Specific Data Type] wikiadmin | ||
|---|---|---|---|
| Line 34: | Line 34: | ||
| See also the examples in this article: [[createvalueobjectscripts| Creating Value Objects in Scripts]] | See also the examples in this article: [[createvalueobjectscripts| Creating Value Objects in Scripts]] | ||
| + | ===Storing a Specific Data Type=== | ||
| + | |||
| + | LongValueObject can store java types boolean, | ||
| + | |||
| + | <code javascript> | ||
| + | |||
| + | var LongValueObject = Java.type(" | ||
| + | var Long = Java.type(" | ||
| + | |||
| + | javaLong = new Long(100); | ||
| + | |||
| + | //now you can get any java type for this value (if it is in range) | ||
| + | byteValue = javaLong.byteValue(); | ||
| + | shortValue = javaLong.shortValue(); | ||
| + | longValue = javaLong.intValue(); | ||
| + | intValue = javaLong.longValue(); | ||
| + | |||
| + | |||
| + | //create the LongValueObject and with a specific type | ||
| + | vo = new LongValueObject(shortValue); | ||
| + | |||
| + | </ | ||
longvalueobjects.1634064167.txt.gz · Last modified: by wikiadmin
