| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.server.admin; |
| | |
| | | |
| | | |
| | | |
| | | import static org.opends.server.util.Validator.ensureNotNull; |
| | | import static org.forgerock.util.Reject.ifNull; |
| | | |
| | | import java.util.EnumSet; |
| | | import java.util.Locale; |
| | |
| | | @Override |
| | | public void validateValue(Integer value) |
| | | throws IllegalPropertyValueException { |
| | | ensureNotNull(value); |
| | | ifNull(value); |
| | | |
| | | if (!allowUnlimited && value < lowerLimit) { |
| | | throw new IllegalPropertyValueException(this, value); |
| | |
| | | @Override |
| | | public String encodeValue(Integer value) |
| | | throws IllegalPropertyValueException { |
| | | ensureNotNull(value); |
| | | ifNull(value); |
| | | |
| | | // Make sure that we correctly encode negative values as "unlimited". |
| | | if (allowUnlimited) { |
| | |
| | | @Override |
| | | public Integer decodeValue(String value) |
| | | throws IllegalPropertyValueStringException { |
| | | ensureNotNull(value); |
| | | ifNull(value); |
| | | |
| | | if (allowUnlimited) { |
| | | if (value.trim().equalsIgnoreCase(UNLIMITED)) { |