| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.server.admin; |
| | |
| | | public static class Builder<E extends Enum<E>> extends |
| | | AbstractBuilder<E, EnumPropertyDefinition<E>> { |
| | | |
| | | // The enumeration class. |
| | | /** The enumeration class. */ |
| | | private Class<E> enumClass; |
| | | |
| | | |
| | | |
| | | // Private constructor |
| | | /** Private constructor. */ |
| | | private Builder( |
| | | AbstractManagedObjectDefinition<?, ?> d, String propertyName) { |
| | | super(d, propertyName); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected EnumPropertyDefinition<E> buildInstance( |
| | | AbstractManagedObjectDefinition<?, ?> d, String propertyName, |
| | |
| | | return new Builder<E>(d, propertyName); |
| | | } |
| | | |
| | | // The enumeration class. |
| | | /** The enumeration class. */ |
| | | private final Class<E> enumClass; |
| | | |
| | | // Map used for decoding values. |
| | | /** Map used for decoding values. */ |
| | | private final Map<String, E> decodeMap; |
| | | |
| | | |
| | | |
| | | // Private constructor. |
| | | /** Private constructor. */ |
| | | private EnumPropertyDefinition(AbstractManagedObjectDefinition<?, ?> d, |
| | | String propertyName, EnumSet<PropertyOption> options, |
| | | AdministratorAction adminAction, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public <R, P> R accept(PropertyDefinitionVisitor<R, P> v, P p) { |
| | | return v.visitEnum(this, p); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public <R, P> R accept(PropertyValueVisitor<R, P> v, E value, P p) { |
| | | return v.visitEnum(this, value, p); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public E decodeValue(String value) |
| | | throws PropertyException { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String normalizeValue(E value) |
| | | throws PropertyException { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void validateValue(E value) |
| | | throws PropertyException { |