Package ai.djl.translate
Class ArgumentsUtil
- java.lang.Object
-
- ai.djl.translate.ArgumentsUtil
-
public final class ArgumentsUtil extends java.lang.ObjectA utility class to extract data from model's arguments.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanbooleanValue(java.util.Map<java.lang.String,?> arguments, java.lang.String key)Returns the boolean value from the arguments.static booleanbooleanValue(java.util.Map<java.lang.String,?> arguments, java.lang.String key, boolean def)Returns the boolean value from the arguments.static floatfloatValue(java.util.Map<java.lang.String,?> arguments, java.lang.String key)Returns the float value from the arguments.static floatfloatValue(java.util.Map<java.lang.String,?> arguments, java.lang.String key, float def)Returns the float value from the arguments.static intintValue(java.util.Map<java.lang.String,?> arguments, java.lang.String key)Returns the integer value from the arguments.static intintValue(java.util.Map<java.lang.String,?> arguments, java.lang.String key, int def)Returns the integer value from the arguments.static longlongValue(java.util.Map<java.lang.String,?> arguments, java.lang.String key)Returns the long value from the arguments.static java.lang.LonglongValue(java.util.Map<java.lang.String,?> arguments, java.lang.String key, long def)Returns the long value from the arguments.static java.lang.StringstringValue(java.util.Map<java.lang.String,?> arguments, java.lang.String key)Returns the string value from the arguments.static java.lang.StringstringValue(java.util.Map<java.lang.String,?> arguments, java.lang.String key, java.lang.String def)Returns the string value from the arguments.
-
-
-
Method Detail
-
stringValue
public static java.lang.String stringValue(java.util.Map<java.lang.String,?> arguments, java.lang.String key)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
public static java.lang.String stringValue(java.util.Map<java.lang.String,?> arguments, java.lang.String key, java.lang.String def)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
public static int intValue(java.util.Map<java.lang.String,?> arguments, java.lang.String key)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
public static int intValue(java.util.Map<java.lang.String,?> arguments, java.lang.String key, int def)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
public static long longValue(java.util.Map<java.lang.String,?> arguments, java.lang.String key)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
public static java.lang.Long longValue(java.util.Map<java.lang.String,?> arguments, java.lang.String key, long def)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
public static float floatValue(java.util.Map<java.lang.String,?> arguments, java.lang.String key)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
public static float floatValue(java.util.Map<java.lang.String,?> arguments, java.lang.String key, float def)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
public static boolean booleanValue(java.util.Map<java.lang.String,?> arguments, java.lang.String key)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
public static boolean booleanValue(java.util.Map<java.lang.String,?> arguments, java.lang.String key, boolean def)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
-
-