A2uiFunctionArgParser


object A2uiFunctionArgParser


Reusable utility methods to parse and validate dynamic arguments passed to catalog functions.

Summary

Public functions

Any
getArg(args: Map<StringAny>, key: String, path: String)

Retrieves a raw argument value from the args map under the given key.

Boolean
getBooleanArg(args: Map<StringAny>, key: String, path: String)

Retrieves a Boolean argument under key supporting either actual Booleans or the case-insensitive strings "true" and "false".

List<Boolean>
getBooleanListArg(args: Map<StringAny>, key: String, path: String)

Retrieves a List of Booleans under key supporting either actual Booleans or the case-insensitive strings "true" and "false".

Double
getDoubleArg(args: Map<StringAny>, key: String, path: String)

Retrieves a Double argument under key.

List<Double>
getDoubleListArg(args: Map<StringAny>, key: String, path: String)

Retrieves a List of Doubles under key.

Long
getEpochMillisArg(args: Map<StringAny>, key: String, path: String)

Retrieves a UTC epoch millisecond timestamp argument under key, supporting numeric timestamps (in seconds or milliseconds) and ISO 8601 date / date-time strings.

Int
getIntArg(args: Map<StringAny>, key: String, path: String)

Retrieves an Int argument under key.

List<Int>
getIntListArg(args: Map<StringAny>, key: String, path: String)

Retrieves a List of Ints under key.

Long
getLongArg(args: Map<StringAny>, key: String, path: String)

Retrieves a Long argument under key.

List<Long>
getLongListArg(args: Map<StringAny>, key: String, path: String)

Retrieves a List of Longs under key.

String
getStringArg(args: Map<StringAny>, key: String, path: String)

Retrieves a String argument under key.

List<String>
getStringListArg(args: Map<StringAny>, key: String, path: String)

Retrieves a List of Strings under key.

Public functions

getArg

fun getArg(args: Map<StringAny>, key: String, path: String = "/"): Any

Retrieves a raw argument value from the args map under the given key.

Parameters
args: Map<StringAny>

The map of arguments.

key: String

The argument key to retrieve.

path: String = "/"

The parent context path. The final error path will be constructed as "${path}/${key}".

Returns
Any

The raw argument value.

Throws
A2uiException.A2uiValidationException

if the argument is missing.

getBooleanArg

fun getBooleanArg(args: Map<StringAny>, key: String, path: String = "/"): Boolean

Retrieves a Boolean argument under key supporting either actual Booleans or the case-insensitive strings "true" and "false".

Parameters
args: Map<StringAny>

The map of arguments.

key: String

The argument key.

path: String = "/"

The parent context path. The final error path will be constructed as "${path}/${key}".

Returns
Boolean

The resolved Boolean value.

Throws
A2uiException.A2uiValidationException

if the argument is missing or invalid.

getBooleanListArg

fun getBooleanListArg(args: Map<StringAny>, key: String, path: String = "/"): List<Boolean>

Retrieves a List of Booleans under key supporting either actual Booleans or the case-insensitive strings "true" and "false".

Parameters
args: Map<StringAny>

The map of arguments.

key: String

The argument key.

path: String = "/"

The parent context path. The final element path will be constructed with the index suffix, like ${path}/${key}/${index}.

Returns
List<Boolean>

The resolved List of Booleans.

Throws
A2uiException.A2uiValidationException

if the argument is missing or any element violates constraints.

getDoubleArg

fun getDoubleArg(args: Map<StringAny>, key: String, path: String = "/"): Double

Retrieves a Double argument under key.

Parameters
args: Map<StringAny>

The map of arguments.

key: String

The argument key.

path: String = "/"

The parent context path. The final error path will be constructed as "${path}/${key}".

Returns
Double

The resolved Double value.

Throws
A2uiException.A2uiValidationException

if the argument is missing or invalid.

getDoubleListArg

fun getDoubleListArg(args: Map<StringAny>, key: String, path: String = "/"): List<Double>

Retrieves a List of Doubles under key.

Parameters
args: Map<StringAny>

The map of arguments.

key: String

The argument key.

path: String = "/"

The parent context path. The final element path will be constructed with the index suffix, like ${path}/${key}/${index}.

Returns
List<Double>

The resolved List of Doubles.

Throws
A2uiException.A2uiValidationException

if the argument is missing or any element violates constraints.

getEpochMillisArg

fun getEpochMillisArg(args: Map<StringAny>, key: String, path: String = "/"): Long

Retrieves a UTC epoch millisecond timestamp argument under key, supporting numeric timestamps (in seconds or milliseconds) and ISO 8601 date / date-time strings.

Date-only strings (e.g., "2026-06-15") are normalized to UTC start-of-day. Numeric values less than 10,000,000,000 are treated as epoch seconds, otherwise as epoch milliseconds.

Parameters
args: Map<StringAny>

The map of arguments.

key: String

The argument key.

path: String = "/"

The parent context path. The final error path will be constructed as "${path}/${key}".

Returns
Long

The resolved timestamp in UTC epoch milliseconds.

Throws
A2uiException.A2uiValidationException

if the argument is missing or cannot be parsed as a date or timestamp.

getIntArg

fun getIntArg(args: Map<StringAny>, key: String, path: String = "/"): Int

Retrieves an Int argument under key.

Parameters
args: Map<StringAny>

The map of arguments.

key: String

The argument key.

path: String = "/"

The parent context path. The final error path will be constructed as "${path}/${key}".

Returns
Int

The resolved Int value.

Throws
A2uiException.A2uiValidationException

if the argument is missing or invalid.

getIntListArg

fun getIntListArg(args: Map<StringAny>, key: String, path: String = "/"): List<Int>

Retrieves a List of Ints under key.

Parameters
args: Map<StringAny>

The map of arguments.

key: String

The argument key.

path: String = "/"

The parent context path. The final element path will be constructed with the index suffix, like ${path}/${key}/${index}.

Returns
List<Int>

The resolved List of Ints.

Throws
A2uiException.A2uiValidationException

if the argument is missing or any element violates constraints.

getLongArg

fun getLongArg(args: Map<StringAny>, key: String, path: String = "/"): Long

Retrieves a Long argument under key.

Parameters
args: Map<StringAny>

The map of arguments.

key: String

The argument key.

path: String = "/"

The parent context path. The final error path will be constructed as "${path}/${key}".

Returns
Long

The resolved Long value.

Throws
A2uiException.A2uiValidationException

if the argument is missing or invalid.

getLongListArg

fun getLongListArg(args: Map<StringAny>, key: String, path: String = "/"): List<Long>

Retrieves a List of Longs under key.

Parameters
args: Map<StringAny>

The map of arguments.

key: String

The argument key.

path: String = "/"

The parent context path. The final element path will be constructed with the index suffix, like ${path}/${key}/${index}.

Returns
List<Long>

The resolved List of Longs.

Throws
A2uiException.A2uiValidationException

if the argument is missing or any element violates constraints.

getStringArg

fun getStringArg(args: Map<StringAny>, key: String, path: String = "/"): String

Retrieves a String argument under key.

Parameters
args: Map<StringAny>

The map of arguments.

key: String

The argument key.

path: String = "/"

The parent context path. The final error path will be constructed as "${path}/${key}".

Returns
String

The resolved String value.

Throws
A2uiException.A2uiValidationException

if the argument is missing, invalid or violates constraints.

getStringListArg

fun getStringListArg(args: Map<StringAny>, key: String, path: String = "/"): List<String>

Retrieves a List of Strings under key.

Parameters
args: Map<StringAny>

The map of arguments.

key: String

The argument key.

path: String = "/"

The parent context path. The final element path will be constructed with the index suffix, like ${path}/${key}/${index}.

Returns
List<String>

The resolved List of Strings.

Throws
A2uiException.A2uiValidationException

if the argument is missing or any element violates constraints.