pdk.util.Cast
functions to convert variables between different structures
Functions
booleanToString
Converts a boolean value to a string representation.
Arguments:
variable :: pdk.core.Boolean
Result:
output :: pdk.core.String
Possible exceptions
NullPointerException - throws if the variable argument is
NULL
dateToString
Converts a date object to a string representation using the specified format.
Format examples:
Date and Time Pattern | Result |
---|---|
'yyyy-MM-dd' | 2001-07-04 |
'YYYY-MM-dd'T'HH:mm:ss' | 2001-07-04T12:08:56 |
'yyyy.MM.dd G 'at' HH:mm:ss z' | 2001.07.04 AD at 12:08:56 PDT |
'EEE, MMM d, ''yy' | Wed, Jul 4, '01 |
'h:mm a' | 12:08 PM |
'hh 'o''clock' a, zzzz' | 12 o'clock PM, Pacific Daylight Time |
'K:mm a, z' | 0:08 PM, PDT |
'yyyyy.MMMMM.dd GGG hh:mm aaa' | 02001.July.04 AD 12:08 PM |
'EEE, d MMM yyyy HH:mm:ss Z' | Wed, 4 Jul 2001 12:08:56 -0700 |
'yyMMddHHmmssZ' | 010704120856-0700 |
'yyyy-MM-dd'T'HH:mm:ss.SSSZ' | 2001-07-04T12:08:56.235-0700 |
'yyyy-MM-dd'T'HH:mm:ss.SSSXXX' | 2001-07-04T12:08:56.235-07:00 |
'YYYY-\'W\'ww-u' | 2001-W27-3 |
Arguments:
variable :: pdk.core.Date
format :: pdk.core.String
Result:
output :: pdk.core.String
Possible exceptions
NullPointerException - throws if the variable or format argument is
NULL
dateToStringISO
Converts a date object to a string representation in ISO format (YYYY-MM-DDTHH:MM:SSZ).
Arguments:
variable :: pdk.core.Date
Result:
output :: pdk.core.String
Possible exceptions
NullPointerException - throws if the variable argument is
NULL
integerToFloat
Converts an integer value to a floating-point number.
Arguments:
variable :: pdk.core.Integer
Result:
output :: pdk.core.Float
Possible exceptions
NullPointerException - throws if the variable argument is
NULL
integerToString
Converts an integer value to a string representation.
Arguments:
variable :: pdk.core.Integer
Result:
output :: pdk.core.String
Possible exceptions
NullPointerException - throws if the variable argument is
NULL
integerToDate
Converts an integer value to a date object.
Arguments:
variable :: pdk.core.Integer
Result:
output :: pdk.core.Date
Possible exceptions
NullPointerException - throws if the variable argument is
NULL
floatToString
Converts a floating-point number to a string representation.
Arguments:
variable :: pdk.core.Float
Result:
output :: pdk.core.String
Possible exceptions
NullPointerException - throws if the variable argument is
NULL
stringToInteger
Parses the string argument as a signed decimal integer. The characters in the string must all be decimal digits, except that the first character may be an ASCII minus sign '-' to indicate a negative value or an ASCII plus sign '+' to indicate a positive value.
Arguments:
variable :: pdk.core.String
Result:
output :: pdk.core.Integer
Possible exceptions
NullPointerException - throws if the variable argument is
NULL
stringToFloat
Converts a string representation of a floating-point number to a floating-point number.
Arguments:
variable :: pdk.core.String
Result:
output :: pdk.core.Float
Possible exceptions
NullPointerException - throws if the variable argument is
NULL
stringToBoolean
Parses the string argument as a boolean. The boolean returned represents the value true if the string arguments not null and is equal, ignoring case, to the string "true".
Arguments:
variable :: pdk.core.String
Result:
output :: pdk.core.Boolean
Possible exceptions
NullPointerException - throws if the variable argument is
NULL
stringToDateISO
Converts string to date by using ISO format: YYYY-MM-DDTHH:MM:SSZ (2023-10-20T08:24:45−07:00)
.
Arguments:
variable :: pdk.core.String
Result:
output :: pdk.core.Date
Possible exceptions
NullPointerException - throws if the variable argument is
NULL
Last updated