java.lang.Object
dev.nipafx.args.Args
Parses command-line arguments to args records - call
parse
or one of its overloads (depending on how many args types are involved).-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <ARGS_TYPE_1,ARGS_TYPE_2>
Parsed2<ARGS_TYPE_1, ARGS_TYPE_2> Parses the specified string array to create instances of the specified types.static <ARGS_TYPE_1,ARGS_TYPE_2, ARGS_TYPE_3>
Parsed3<ARGS_TYPE_1, ARGS_TYPE_2, ARGS_TYPE_3> parse(String[] argStrings, Class<ARGS_TYPE_1> type1, Class<ARGS_TYPE_2> type2, Class<ARGS_TYPE_3> type3) Parses the specified string array to create instances of the specified types.static <ARGS_TYPE>
ARGS_TYPEParses the specified string array to create an instance of the specified type.
-
Constructor Details
-
Args
public Args()
-
-
Method Details
-
parse
public static <ARGS_TYPE> ARGS_TYPE parse(String[] argStrings, Class<ARGS_TYPE> type) throws ArgsParseException Parses the specified string array to create an instance of the specified type.- Throws:
ArgsParseException- when the specified argument array can't be correctly parsedArgsDefinitionException- when the specified type is not a valid args typeIllegalArgumentException- when an illegal argument was passed toparse(it was likelynullas other cases are covered by other exceptions)IllegalStateException- when an unexpected internal state is encountered - this is likely a bug
-
parse
public static <ARGS_TYPE_1,ARGS_TYPE_2> Parsed2<ARGS_TYPE_1,ARGS_TYPE_2> parse(String[] argStrings, Class<ARGS_TYPE_1> type1, Class<ARGS_TYPE_2> type2) throws ArgsParseException Parses the specified string array to create instances of the specified types.- Throws:
ArgsParseException- when the specified argument array can't be correctly parsedArgsDefinitionException- when not all specified types are valid args typesIllegalArgumentException- when an illegal argument was passed toparse(it was likelynullas other cases are covered by other exceptions)IllegalStateException- when an unexpected internal state is encountered - this is likely a bug
-
parse
public static <ARGS_TYPE_1,ARGS_TYPE_2, Parsed3<ARGS_TYPE_1,ARGS_TYPE_3> ARGS_TYPE_2, parseARGS_TYPE_3> (String[] argStrings, Class<ARGS_TYPE_1> type1, Class<ARGS_TYPE_2> type2, Class<ARGS_TYPE_3> type3) throws ArgsParseException Parses the specified string array to create instances of the specified types.- Throws:
ArgsParseException- when the specified argument array can't be correctly parsedArgsDefinitionException- when not all specified types are valid args typesIllegalArgumentException- when an illegal argument was passed toparse(it was likelynullas other cases are covered by other exceptions)IllegalStateException- when an unexpected internal state is encountered - this is likely a bug
-