| | |
| | | |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | |
| | | import org.opends.server.api.EqualityMatchingRule; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.schema.CaseIgnoreEqualityMatchingRuleFactory; |
| | | import org.opends.server.types.ByteSequence; |
| | | import org.opends.server.types.ByteString; |
| | | import org.opends.server.types.DirectoryException; |
| | | |
| | | |
| | | |
| | | /** |
| | | * This class implements an equality matching rule that is intended for testing |
| | | * purposes within the server (e.g., in conjunction with matching rule uses). |
| | |
| | | extends EqualityMatchingRule |
| | | { |
| | | // Indicates whether this matching rule should be considered OBSOLETE. |
| | | private boolean isObsolete; |
| | | private final boolean isObsolete; |
| | | |
| | | // The matching rule that will do all the real work behind the scenes. |
| | | private EqualityMatchingRule caseIgnoreMatchingRule; |
| | | private final EqualityMatchingRule caseIgnoreMatchingRule; |
| | | |
| | | // The name for this matching rule. |
| | | private String name; |
| | | private final String name; |
| | | |
| | | // The OID for this matching rule. |
| | | private String oid; |
| | | private final String oid; |
| | | |
| | | |
| | | |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public Collection<String> getAllNames() |
| | | { |
| | | return Collections.singleton(getName()); |
| | |
| | | * @return The common name for this matching rule, or <CODE>null</CODE> if |
| | | * it does not have a name. |
| | | */ |
| | | @Override |
| | | public String getName() |
| | | { |
| | | return name; |
| | |
| | | * |
| | | * @return The OID for this matching rule. |
| | | */ |
| | | @Override |
| | | public String getOID() |
| | | { |
| | | return oid; |
| | |
| | | * @return The description for this matching rule, or <CODE>null</CODE> if |
| | | * there is none. |
| | | */ |
| | | @Override |
| | | public String getDescription() |
| | | { |
| | | return null; |
| | |
| | | * |
| | | * @return The OID of the syntax with which this matching rule is associated. |
| | | */ |
| | | @Override |
| | | public String getSyntaxOID() |
| | | { |
| | | return caseIgnoreMatchingRule.getSyntaxOID(); |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public boolean isObsolete() |
| | | { |
| | | return isObsolete; |
| | |
| | | * @throws DirectoryException If the provided value is invalid according to |
| | | * the associated attribute syntax. |
| | | */ |
| | | public ByteString normalizeValue(ByteString value) |
| | | @Override |
| | | public ByteString normalizeValue(ByteSequence value) |
| | | throws DirectoryException |
| | | { |
| | | return caseIgnoreMatchingRule.normalizeValue(value); |
| | |
| | | * @return <CODE>true</CODE> if the provided values are equal, or |
| | | * <CODE>false</CODE> if not. |
| | | */ |
| | | public boolean areEqual(ByteString value1, ByteString value2) |
| | | @Override |
| | | public boolean areEqual(ByteSequence value1, ByteSequence value2) |
| | | { |
| | | return caseIgnoreMatchingRule.areEqual(value1, value2); |
| | | } |