Code example for Set

Methods: isEmptysize

0
    @Override 
    protected void recognizeArguments(CommandContext ctx) throws CommandFormatException {
 
        final ParsedCommandLine args = ctx.getParsedCommandLine();
        final Set<String> propertyNames = args.getPropertyNames();
        if(!propertyNames.isEmpty()) {
            final Collection<String> names;
            if(helpArg.isPresent(args)) {
                if(propertyNames.size() == 1) {
                    return; 
                } 
                names = new ArrayList<String>(propertyNames);
                names.remove(helpArg.getFullName());
                names.remove(helpArg.getShortName());
            } else { 
                names = propertyNames;
            } 
            throw new CommandFormatException("Unrecognized argument names: " + names);
        } 
    }