| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.server.admin; |
| | | |
| | | |
| | | |
| | | import static org.opends.server.util.Validator.*; |
| | | import static org.forgerock.util.Reject.*; |
| | | |
| | | import java.util.Comparator; |
| | | import java.util.EnumSet; |
| | |
| | | * The administrator action. |
| | | */ |
| | | public final void setAdministratorAction(AdministratorAction adminAction) { |
| | | ensureNotNull(adminAction); |
| | | ifNull(adminAction); |
| | | this.adminAction = adminAction; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final void setDefaultBehaviorProvider( |
| | | DefaultBehaviorProvider<T> defaultBehavior) { |
| | | ensureNotNull(defaultBehavior); |
| | | ifNull(defaultBehavior); |
| | | this.defaultBehavior = defaultBehavior; |
| | | } |
| | | |
| | |
| | | * The property option. |
| | | */ |
| | | public final void setOption(PropertyOption option) { |
| | | ensureNotNull(option); |
| | | ifNull(option); |
| | | options.add(option); |
| | | } |
| | | |
| | |
| | | Class<T> theClass, String propertyName, EnumSet<PropertyOption> options, |
| | | AdministratorAction adminAction, |
| | | DefaultBehaviorProvider<T> defaultBehavior) { |
| | | ensureNotNull(d, theClass, propertyName); |
| | | ensureNotNull(options, adminAction, defaultBehavior); |
| | | ifNull(d, theClass, propertyName); |
| | | ifNull(options, adminAction, defaultBehavior); |
| | | |
| | | this.definition = d; |
| | | this.theClass = theClass; |
| | |
| | | * the second. |
| | | */ |
| | | public int compare(T o1, T o2) { |
| | | ensureNotNull(o1, o2); |
| | | ifNull(o1, o2); |
| | | |
| | | String s1 = normalizeValue(o1); |
| | | String s2 = normalizeValue(o2); |
| | |
| | | * If the property value is invalid. |
| | | */ |
| | | public String encodeValue(T value) throws IllegalPropertyValueException { |
| | | ensureNotNull(value); |
| | | ifNull(value); |
| | | |
| | | return value.toString(); |
| | | } |
| | |
| | | * If the property value is invalid. |
| | | */ |
| | | public String normalizeValue(T value) throws IllegalPropertyValueException { |
| | | ensureNotNull(value); |
| | | ifNull(value); |
| | | |
| | | return encodeValue(value); |
| | | } |