Class ArgumentsUtil

java.lang.Object
ai.djl.translate.ArgumentsUtil

public final class ArgumentsUtil extends Object
A utility class to extract data from model's arguments.
  • Method Details

    • stringValue

      public static String stringValue(Map<String,?> arguments, String key)
      Returns the string value from the arguments.
      Parameters:
      arguments - the arguments to retrieve data
      key - the key to retrieve
      Returns:
      the string value form the arguments
    • stringValue

      public static String stringValue(Map<String,?> arguments, String key, String def)
      Returns the string value from the arguments.
      Parameters:
      arguments - the arguments to retrieve data
      key - the key to retrieve
      def - the default value if key is absent
      Returns:
      the string value form the arguments
    • intValue

      public static int intValue(Map<String,?> arguments, String key)
      Returns the integer value from the arguments.
      Parameters:
      arguments - the arguments to retrieve data
      key - the key to retrieve
      Returns:
      the integer value form the arguments
    • intValue

      public static int intValue(Map<String,?> arguments, String key, int def)
      Returns the integer value from the arguments.
      Parameters:
      arguments - the arguments to retrieve data
      key - the key to retrieve
      def - the default value if key is absent
      Returns:
      the integer value form the arguments
    • longValue

      public static long longValue(Map<String,?> arguments, String key)
      Returns the long value from the arguments.
      Parameters:
      arguments - the arguments to retrieve data
      key - the key to retrieve
      Returns:
      the long value form the arguments
    • longValue

      public static Long longValue(Map<String,?> arguments, String key, long def)
      Returns the long value from the arguments.
      Parameters:
      arguments - the arguments to retrieve data
      key - the key to retrieve
      def - the default value if key is absent
      Returns:
      the long value form the arguments
    • floatValue

      public static float floatValue(Map<String,?> arguments, String key)
      Returns the float value from the arguments.
      Parameters:
      arguments - the arguments to retrieve data
      key - the key to retrieve
      Returns:
      the float value form the arguments
    • floatValue

      public static float floatValue(Map<String,?> arguments, String key, float def)
      Returns the float value from the arguments.
      Parameters:
      arguments - the arguments to retrieve data
      key - the key to retrieve
      def - the default value if key is absent
      Returns:
      the float value form the arguments
    • booleanValue

      public static boolean booleanValue(Map<String,?> arguments, String key)
      Returns the boolean value from the arguments.
      Parameters:
      arguments - the arguments to retrieve data
      key - the key to retrieve
      Returns:
      the boolean value form the arguments
    • booleanValue

      public static boolean booleanValue(Map<String,?> arguments, String key, boolean def)
      Returns the boolean value from the arguments.
      Parameters:
      arguments - the arguments to retrieve data
      key - the key to retrieve
      def - the default value if key is absent
      Returns:
      the boolean value form the arguments