Align Attribute with SDK APIs: containsAll(Collection<ByteString>) => containsAll(Collection<?>)
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2012-2014 ForgeRock AS |
| | | * Portions Copyright 2012-2016 ForgeRock AS |
| | | */ |
| | | package org.opends.server.api; |
| | | |
| | |
| | | * {@code false} if it will not generate at least one of |
| | | * them. |
| | | */ |
| | | public boolean hasAllValues(Entry entry, VirtualAttributeRule rule, |
| | | Collection<ByteString> values) |
| | | public boolean hasAllValues(Entry entry, VirtualAttributeRule rule, Collection<?> values) |
| | | { |
| | | return getValues(entry, rule).containsAll(values); |
| | | } |
| | |
| | | // No implementation required. |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | * <p> |
| | | * This implementation iterates through each attribute value in the |
| | | * provided collection, checking to see if this attribute contains |
| | | * the value using {@link #contains(ByteString)}. |
| | | */ |
| | | @Override |
| | | public boolean containsAll(Collection<ByteString> values) |
| | | public boolean containsAll(Collection<?> values) |
| | | { |
| | | for (ByteString value : values) |
| | | for (Object value : values) |
| | | { |
| | | if (!contains(value)) |
| | | if (!contains(ByteString.valueOfObject(value))) |
| | | { |
| | | return false; |
| | | } |
| | |
| | | * values in the provided collection, or {@code false} |
| | | * if it does not contain at least one of them. |
| | | */ |
| | | boolean containsAll(Collection<ByteString> values); |
| | | boolean containsAll(Collection<?> values); |
| | | |
| | | /** |
| | | * Indicates whether this attribute matches the specified assertion value. |
| | |
| | | |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | /** |
| | | * A real attribute - options handled by sub-classes. |
| | | */ |
| | | /** A real attribute */ |
| | | private static class RealAttribute extends AbstractAttribute |
| | | { |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | |
| | | return values.contains(createAttributeValue(attributeType, value)); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Indicates whether this attribute builder contains all the values |
| | | * in the collection. |
| | |
| | | * <CODE>false</CODE> if it does not contain at least one |
| | | * of them. |
| | | */ |
| | | public boolean containsAll(Collection<ByteString> values) |
| | | public boolean containsAll(Collection<?> values) |
| | | { |
| | | for (ByteString v : values) |
| | | for (Object v : values) |
| | | { |
| | | if (!contains(v)) |
| | | if (!contains(ByteString.valueOfObject(v))) |
| | | { |
| | | return false; |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public boolean containsAll(Collection<ByteString> values) |
| | | public boolean containsAll(Collection<?> values) |
| | | { |
| | | return provider.hasAllValues(entry, rule, values); |
| | | } |