| | |
| | | * |
| | | * The last is an example of a multi-valued RDN; that is, an RDN |
| | | * composed of multiple AVAs. |
| | | * <p> |
| | | * TODO: need more constructors. |
| | | * |
| | | * @see <a href="http://tools.ietf.org/html/rfc4512#section-2.3">RFC |
| | | * 4512 - Lightweight Directory Access Protocol (LDAP): Directory |
| | |
| | | |
| | | |
| | | /** |
| | | * Creates a new attribute value assertion (AVA) using the provided |
| | | * attribute type and value decoded using the default schema. |
| | | * <p> |
| | | * If {@code attributeValue} is not an instance of {@code |
| | | * ByteString} then it will be converted using the |
| | | * {@link ByteString#valueOf(Object)} method. |
| | | * |
| | | * @param attributeType |
| | | * The attribute type. |
| | | * @param attributeValue |
| | | * The attribute value. |
| | | * @throws UnknownSchemaElementException |
| | | * If {@code attributeType} was not found in the default |
| | | * schema. |
| | | * @throws NullPointerException |
| | | * If {@code attributeType} or {@code attributeValue} was |
| | | * {@code null}. |
| | | */ |
| | | public AVA(String attributeType, Object attributeValue) |
| | | throws UnknownSchemaElementException, NullPointerException |
| | | { |
| | | Validator.ensureNotNull(attributeType, attributeValue); |
| | | |
| | | this.attributeType = Schema.getDefaultSchema().getAttributeType( |
| | | attributeType); |
| | | this.attributeValue = ByteString.valueOf(attributeValue); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public int compareTo(AVA ava) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates a new RDN using the provided attribute type and value. |
| | | * |
| | | * @param attributeType |
| | | * The attribute type. |
| | | * @param attributeValue |
| | | * The attribute value. |
| | | * @throws NullPointerException |
| | | * If {@code attributeType} or {@code attributeValue} was |
| | | * {@code null}. |
| | | */ |
| | | public RDN(AttributeType attributeType, ByteString attributeValue) |
| | | throws NullPointerException |
| | | { |
| | | this.avas = new AVA[] { new AVA(attributeType, attributeValue) }; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates a new RDN using the provided attribute type and value |
| | | * decoded using the default schema. |
| | | * <p> |
| | | * If {@code attributeValue} is not an instance of {@code ByteString} |
| | | * then it will be converted using the |
| | | * {@link ByteString#valueOf(Object)} method. |
| | | * |
| | | * @param attributeType |
| | | * The attribute type. |
| | | * @param attributeValue |
| | | * The attribute value. |
| | | * @throws UnknownSchemaElementException |
| | | * If {@code attributeType} was not found in the default |
| | | * schema. |
| | | * @throws NullPointerException |
| | | * If {@code attributeType} or {@code attributeValue} was |
| | | * {@code null}. |
| | | */ |
| | | public RDN(String attributeType, Object attributeValue) |
| | | throws UnknownSchemaElementException, NullPointerException |
| | | { |
| | | this.avas = new AVA[] { new AVA(attributeType, attributeValue) }; |
| | | } |
| | | |
| | | |
| | | |
| | | private RDN(AVA[] avas, String stringValue) |
| | | { |
| | | this.avas = avas; |