/** * Retrieves the set of attributes contained in this entry. * * @return The set of attributes contained in this entry. */ public Collection<Attribute> getAttributes() { final ArrayList<Attribute> attrList = new ArrayList<Attribute>(attributes.length); for (final CompactAttribute a : attributes) { attrList.add(a.toAttribute()); } return Collections.unmodifiableCollection(attrList); }
/** * Retrieves the set of attributes contained in this entry. * * @return The set of attributes contained in this entry. */ public Collection<Attribute> getAttributes() { final ArrayList<Attribute> attrList = new ArrayList<Attribute>(attributes.length); for (final CompactAttribute a : attributes) { attrList.add(a.toAttribute()); } return Collections.unmodifiableCollection(attrList); }
/** * Converts this compact entry to a full entry. * * @return The entry created from this compact entry. */ public Entry toEntry() { final Attribute[] attrs = new Attribute[attributes.length]; for (int i=0; i < attributes.length; i++) { attrs[i] = attributes[i].toAttribute(); } return new Entry(dn, attrs); }
/** * Converts this compact entry to a full entry. * * @return The entry created from this compact entry. */ public Entry toEntry() { final Attribute[] attrs = new Attribute[attributes.length]; for (int i=0; i < attributes.length; i++) { attrs[i] = attributes[i].toAttribute(); } return new Entry(dn, attrs); }
/** * Appends a string representation of this entry to the provided buffer. * * @param buffer The buffer to which to append the string representation of * this entry. */ public void toString(final StringBuilder buffer) { buffer.append("Entry(dn='"); buffer.append(dn); buffer.append("', attributes={"); for (int i=0; i < attributes.length; i++) { if (i > 0) { buffer.append(", "); } attributes[i].toAttribute().toString(buffer); } buffer.append("})"); } }
/** * Appends a string representation of this entry to the provided buffer. * * @param buffer The buffer to which to append the string representation of * this entry. */ public void toString(final StringBuilder buffer) { buffer.append("Entry(dn='"); buffer.append(dn); buffer.append("', attributes={"); for (int i=0; i < attributes.length; i++) { if (i > 0) { buffer.append(", "); } attributes[i].toAttribute().toString(buffer); } buffer.append("})"); } }
/** * Retrieves the attribute with the specified name. * * @param attributeName The name of the attribute to retrieve. It must not * be {@code null}. * * @return The requested attribute from this entry, or {@code null} if the * specified attribute is not present in this entry. */ public Attribute getAttribute(final String attributeName) { ensureNotNull(attributeName); for (final CompactAttribute a : attributes) { if (a.getName().equalsIgnoreCase(attributeName)) { return a.toAttribute(); } } return null; }
/** * Retrieves the attribute with the specified name. * * @param attributeName The name of the attribute to retrieve. It must not * be {@code null}. * * @return The requested attribute from this entry, or {@code null} if the * specified attribute is not present in this entry. */ public Attribute getAttribute(final String attributeName) { ensureNotNull(attributeName); for (final CompactAttribute a : attributes) { if (a.getName().equalsIgnoreCase(attributeName)) { return a.toAttribute(); } } return null; }
/** * Indicates whether this entry contains the specified attribute. It will * only return {@code true} if this entry contains an attribute with the same * name and exact set of values. * * @param attribute The attribute for which to make the determination. It * must not be {@code null}. * * @return {@code true} if this entry contains the specified attribute, or * {@code false}. */ public boolean hasAttribute(final Attribute attribute) { ensureNotNull(attribute); for (final CompactAttribute a : attributes) { if (a.toAttribute().equals(attribute)) { return true; } } return false; }
/** * Indicates whether this entry contains the specified attribute. It will * only return {@code true} if this entry contains an attribute with the same * name and exact set of values. * * @param attribute The attribute for which to make the determination. It * must not be {@code null}. * * @return {@code true} if this entry contains the specified attribute, or * {@code false}. */ public boolean hasAttribute(final Attribute attribute) { ensureNotNull(attribute); for (final CompactAttribute a : attributes) { if (a.toAttribute().equals(attribute)) { return true; } } return false; }
/** * Indicates whether this entry contains an attribute with the given name and * value. * * @param attributeName The name of the attribute for which to make the * determination. It must not be {@code null}. * @param attributeValue The value for which to make the determination. It * must not be {@code null}. * * @return {@code true} if this entry contains an attribute with the * specified name and value, or {@code false} if not. */ public boolean hasAttributeValue(final String attributeName, final byte[] attributeValue) { ensureNotNull(attributeName, attributeValue); for (final CompactAttribute a : attributes) { if (a.getName().equalsIgnoreCase(attributeName) && a.toAttribute().hasValue(attributeValue)) { return true; } } return false; }
/** * Indicates whether this entry contains an attribute with the given name and * value. * * @param attributeName The name of the attribute for which to make the * determination. It must not be {@code null}. * @param attributeValue The value for which to make the determination. It * must not be {@code null}. * * @return {@code true} if this entry contains an attribute with the * specified name and value, or {@code false} if not. */ public boolean hasAttributeValue(final String attributeName, final String attributeValue) { ensureNotNull(attributeName, attributeValue); for (final CompactAttribute a : attributes) { if (a.getName().equalsIgnoreCase(attributeName) && a.toAttribute().hasValue(attributeValue)) { return true; } } return false; }
/** * Indicates whether this entry contains an attribute with the given name and * value. * * @param attributeName The name of the attribute for which to make the * determination. It must not be {@code null}. * @param attributeValue The value for which to make the determination. It * must not be {@code null}. * * @return {@code true} if this entry contains an attribute with the * specified name and value, or {@code false} if not. */ public boolean hasAttributeValue(final String attributeName, final String attributeValue) { ensureNotNull(attributeName, attributeValue); for (final CompactAttribute a : attributes) { if (a.getName().equalsIgnoreCase(attributeName) && a.toAttribute().hasValue(attributeValue)) { return true; } } return false; }
/** * Indicates whether this entry contains an attribute with the given name and * value. * * @param attributeName The name of the attribute for which to make the * determination. It must not be {@code null}. * @param attributeValue The value for which to make the determination. It * must not be {@code null}. * * @return {@code true} if this entry contains an attribute with the * specified name and value, or {@code false} if not. */ public boolean hasAttributeValue(final String attributeName, final byte[] attributeValue) { ensureNotNull(attributeName, attributeValue); for (final CompactAttribute a : attributes) { if (a.getName().equalsIgnoreCase(attributeName) && a.toAttribute().hasValue(attributeValue)) { return true; } } return false; }