Data Types

Supported Data Type

Example

Note

Boolean

Bool = true;

OtherBool = false;

Boolean values can be set as either true or false.

Date

Date DateExample = 1987-12-20T04:04:30

The Date must be in the ISO format yyyy-mm-ddThh:mm:ss.

No other formats are allowed.

Double

double example1 = 5.5;

double example2 -3.4;

double example3 = 3;

 

Integer

int z = 4 + 5.5

Assignment expressions in math such as / or * that have double values as part of the expression will truncate the decimal.

In the example, int z = 9

Object reference

<Resource> res = new <Resource>;

<Resource> res2 = null;

<Resource> res3 = <Resource>.findOne(r → 2 == 2);

References to all the fields of the object are included by default once you declare an object variable.

null

Note: You can set a variable of any data type to null, but you cannot create a null type variable.

int i1 = null;

double i2 = null;

Date i3 = null;

<Resource> myResource = null;

myResource.ObjectId = null;

 

String

String sample = "Hello World"

 



Legal Notices | Your Privacy Rights
Copyright © 2019, 2022

Last Published Thursday, August 25, 2022