mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Valery Kharseko
11 hours ago 4c7057e45ba8a2f3bc1f0b02b3edf14886fd1956
opendj-cli/src/main/java/com/forgerock/opendj/cli/IntegerArgument.java
@@ -13,6 +13,7 @@
 *
 * Copyright 2006-2010 Sun Microsystems, Inc.
 * Portions copyright 2014-2016 ForgeRock AS.
 * Portions Copyright 2026 3A Systems, LLC.
 */
package com.forgerock.opendj.cli;
@@ -105,6 +106,25 @@
    }
    /**
     * 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.
     *