| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions copyright 2012-2014 ForgeRock AS. |
| | | * Portions copyright 2012-2015 ForgeRock AS. |
| | | */ |
| | | package com.forgerock.opendj.cli; |
| | | |
| | |
| | | |
| | | /** Description for this group of arguments. */ |
| | | private LocalizableMessage description; |
| | | |
| | | /** List of arguments belonging to this group. */ |
| | | private List<Argument> args; |
| | | |
| | | /** Governs groups position within usage statement. */ |
| | | private final Integer priority; |
| | | |
| | |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public int compareTo(final ArgumentGroup o) { |
| | | // Groups with higher priority numbers appear before |
| | | // those with lower priority in the usage output |
| | |
| | | * @return boolean where true indicates the add was successful |
| | | */ |
| | | public boolean addArgument(final Argument arg) { |
| | | boolean success = false; |
| | | if (arg != null) { |
| | | final Character newShort = arg.getShortIdentifier(); |
| | | final String newLong = arg.getLongIdentifier(); |
| | |
| | | } |
| | | } |
| | | |
| | | success = this.args.add(arg); |
| | | return this.args.add(arg); |
| | | } |
| | | return success; |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | |
| | | this.description = description; |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String toString() { |
| | | return getClass().getSimpleName() + "(description=" + description + ")"; |
| | | } |
| | | } |