| | |
| | | */ |
| | | public final class DNPropertyDefinition extends PropertyDefinition<DN> { |
| | | |
| | | // Optional base DN which all valid values must be immediately |
| | | // subordinate to. |
| | | /** |
| | | * Optional base DN which all valid values must be immediately |
| | | * subordinate to. |
| | | */ |
| | | private final DN baseDN; |
| | | |
| | | /** |
| | |
| | | */ |
| | | public static final class Builder extends AbstractBuilder<DN, DNPropertyDefinition> { |
| | | |
| | | // Optional base DN which all valid values must be immediately |
| | | // subordinate to. |
| | | /** |
| | | * Optional base DN which all valid values must be immediately |
| | | * subordinate to. |
| | | */ |
| | | private DN baseDN = null; |
| | | |
| | | // Private constructor |
| | | /** Private constructor. */ |
| | | private Builder(AbstractManagedObjectDefinition<?, ?> d, String propertyName) { |
| | | super(d, propertyName); |
| | | } |
| | |
| | | this.baseDN = baseDN; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected DNPropertyDefinition buildInstance(AbstractManagedObjectDefinition<?, ?> d, String propertyName, |
| | | EnumSet<PropertyOption> options, AdministratorAction adminAction, |
| | |
| | | return new Builder(d, propertyName); |
| | | } |
| | | |
| | | // Private constructor. |
| | | /** Private constructor. */ |
| | | private DNPropertyDefinition(AbstractManagedObjectDefinition<?, ?> d, String propertyName, |
| | | EnumSet<PropertyOption> options, AdministratorAction adminAction, |
| | | DefaultBehaviorProvider<DN> defaultBehavior, DN baseDN) { |
| | |
| | | return baseDN; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void validateValue(DN value) { |
| | | Reject.ifNull(value); |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public DN decodeValue(String value) { |
| | | Reject.ifNull(value); |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public <R, P> R accept(PropertyDefinitionVisitor<R, P> v, P p) { |
| | | return v.visitDN(this, p); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public <R, P> R accept(PropertyValueVisitor<R, P> v, DN value, P p) { |
| | | return v.visitDN(this, value, p); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public int compare(DN o1, DN o2) { |
| | | return o1.compareTo(o2); |