Class YmlMap

java.lang.Object
io.sbk.params.YmlMap

public abstract class YmlMap extends Object
Helper base class for mapping YAML files to CLI argument arrays.

Subclasses represent the expected YAML structure. getYmlArgs(String, Class) reads a YAML file into the given YmlMap subclass and converts its args map into a String[] suitable for feeding into SBK's CLI parser.

  • Field Details

    • args

      public Map<String,String> args
      Key-value pairs that will be transformed into CLI arguments.
  • Constructor Details

    • YmlMap

      public YmlMap(Map<String,String> args)
      Create a YmlMap with the provided arguments map.
      Parameters:
      args - mapping of option name to value
  • Method Details

    • getYmlArgs

      @NotNull public static @NotNull String[] getYmlArgs(String fileName, Class<? extends YmlMap> tClass) throws IOException
      Read a YAML file and convert its args map into a CLI argument array.
      Parameters:
      fileName - path to YAML file
      tClass - concrete YmlMap subclass to deserialize into
      Returns:
      array of CLI arguments (e.g., ["-option", "value", ...])
      Throws:
      IOException - if the YAML file cannot be read or parsed