| | |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions copyright 2014-2016 ForgeRock AS. |
| | | * Portions Copyright 2026 3A Systems, LLC. |
| | | */ |
| | | package com.forgerock.opendj.cli; |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * Returns the default value of this argument as an int. |
| | | * <p> |
| | | * The default value of an integer argument is always built from an {@code int}, so the only |
| | | * reason for this method to return the fallback value is that this argument has no default |
| | | * value at all. |
| | | * |
| | | * @param fallbackValue |
| | | * The value to return if this argument does not have a default value. |
| | | * @return The default value of this argument, or {@code fallbackValue} if it does not have one. |
| | | */ |
| | | public int getDefaultIntValue(final int fallbackValue) { |
| | | try { |
| | | return Integer.parseInt(getDefaultValue()); |
| | | } catch (final NumberFormatException e) { |
| | | return fallbackValue; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Indicates whether the provided value is acceptable for use in this |
| | | * argument. |
| | | * |