public final class OptionGroups extends Object
The following table gives short overview of the behaviour of different factory methods. Supposed n individual options were passed as arguments to each method. The Min and Max shown the number that is needed for the group option to be "consistent":
Please note that the anyOf(org.netbeans.spi.sendopts.Option...)
is in fact always consistent,
regardless any number of the given options appears on the command line or not.
As such it serves slightly different purpose than the other methods listed
in the table.
More detailed description of the behaviour of each method is given in their appropriate javadoc.
Modifier and Type | Method and Description |
---|---|
static Option |
allOf(Option... options)
Creates a compound option that forces all of the sub options
to appear on the command line.
|
static Option |
anyOf(Option... options)
A voluntary selector that allows any of the specified options to appear
on the command line, but if they do not appear, the command line is
still consistent.
|
static Option |
oneOf(Option... options)
Creates a selector option that forces exactly one of the sub options
to appear on the command line.
|
static Option |
someOf(Option... options)
Combines a set of multiple options into one compound one.
|
public static Option someOf(Option... options)
OptionProcessor
that want to process more than one
option and want to do all the logic of choosing which options can
be used together with others by themselves. The newly created
options will be contained in the map passed to
OptionProcessor.process(org.netbeans.spi.sendopts.Env, java.util.Map<org.netbeans.spi.sendopts.Option, java.lang.String[]>)
method if at least one of the
parameters appeared on the command line. The value associated with
the compound option is always going to be new String[0]
, however
the map will contain all options that appeared and their values which
can then be processed one by one.options
- the sub options to check on the command lineis activatedif at least one of the options appears on the command line
public static Option anyOf(Option... options)
OptionProcessor.process(org.netbeans.spi.sendopts.Env, java.util.Map<org.netbeans.spi.sendopts.Option, java.lang.String[]>)
will contain the returned compound option
with associated value of new String[0]
.options
- the sub options to check on the command lineis activatedif at least one of the options appears on the command line
public static Option oneOf(Option... options)
OptionProcessor.process(org.netbeans.spi.sendopts.Env, java.util.Map<org.netbeans.spi.sendopts.Option, java.lang.String[]>)
's
map, then the selector option is always associated with new String[0]
value, however there is also one of the sub options, with its associated
value.options
- the options to select one frompublic static Option allOf(Option... options)
OptionProcessor.process(org.netbeans.spi.sendopts.Env, java.util.Map<org.netbeans.spi.sendopts.Option, java.lang.String[]>)
's
map, then the compound option is always associated with new String[0]
value, however there are all the sub options, with their associated
values.options
- the options to select one from