Class FlagSet


  • public final class FlagSet
    extends Object
    Contains the set of flags used in a command. A flag is defined by a name and an optional value.
    • Method Detail

      • builder

        public static FlagSet.FlagSetBuilder builder()
        Creates a builder to configure a new set of flags.
        Returns:
        a flag builder
      • get

        public Optional<String> get​(String name)
        Gets the value of the flag with the given name. If the flag has no value, the value is an empty string. If the flag is not present at all, and empty Optional is returned.
        Parameters:
        name - the name of the flag to look for
        Returns:
        the value of the flag, or empty optional if flag is not present