Package ai.djl.translate
Class ArgumentsUtil
java.lang.Object
ai.djl.translate.ArgumentsUtil
A utility class to extract data from model's arguments.
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanbooleanValue(Map<String, ?> arguments, String key) Returns the boolean value from the arguments.static booleanbooleanValue(Map<String, ?> arguments, String key, boolean def) Returns the boolean value from the arguments.static floatfloatValue(Map<String, ?> arguments, String key) Returns the float value from the arguments.static floatfloatValue(Map<String, ?> arguments, String key, float def) Returns the float value from the arguments.static intReturns the integer value from the arguments.static intReturns the integer value from the arguments.static longReturns the long value from the arguments.static LongReturns the long value from the arguments.static StringstringValue(Map<String, ?> arguments, String key) Returns the string value from the arguments.static StringstringValue(Map<String, ?> arguments, String key, String def) Returns the string value from the arguments.
-
Method Details
-
stringValue
Returns the string value from the arguments.- Parameters:
arguments- the arguments to retrieve datakey- the key to retrieve- Returns:
- the string value form the arguments
-
stringValue
Returns the string value from the arguments.- Parameters:
arguments- the arguments to retrieve datakey- the key to retrievedef- the default value if key is absent- Returns:
- the string value form the arguments
-
intValue
Returns the integer value from the arguments.- Parameters:
arguments- the arguments to retrieve datakey- the key to retrieve- Returns:
- the integer value form the arguments
-
intValue
Returns the integer value from the arguments.- Parameters:
arguments- the arguments to retrieve datakey- the key to retrievedef- the default value if key is absent- Returns:
- the integer value form the arguments
-
longValue
Returns the long value from the arguments.- Parameters:
arguments- the arguments to retrieve datakey- the key to retrieve- Returns:
- the long value form the arguments
-
longValue
Returns the long value from the arguments.- Parameters:
arguments- the arguments to retrieve datakey- the key to retrievedef- the default value if key is absent- Returns:
- the long value form the arguments
-
floatValue
Returns the float value from the arguments.- Parameters:
arguments- the arguments to retrieve datakey- the key to retrieve- Returns:
- the float value form the arguments
-
floatValue
Returns the float value from the arguments.- Parameters:
arguments- the arguments to retrieve datakey- the key to retrievedef- the default value if key is absent- Returns:
- the float value form the arguments
-
booleanValue
Returns the boolean value from the arguments.- Parameters:
arguments- the arguments to retrieve datakey- the key to retrieve- Returns:
- the boolean value form the arguments
-
booleanValue
Returns the boolean value from the arguments.- Parameters:
arguments- the arguments to retrieve datakey- the key to retrievedef- the default value if key is absent- Returns:
- the boolean value form the arguments
-