001/* 002 * Licensed to the Apache Software Foundation (ASF) under one 003 * or more contributor license agreements. See the NOTICE file 004 * distributed with this work for additional information 005 * regarding copyright ownership. The ASF licenses this file 006 * to you under the Apache License, Version 2.0 (the 007 * "License"); you may not use this file except in compliance 008 * with the License. You may obtain a copy of the License at 009 * 010 * http://www.apache.org/licenses/LICENSE-2.0 011 * 012 * Unless required by applicable law or agreed to in writing, 013 * software distributed under the License is distributed on an 014 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 015 * KIND, either express or implied. See the License for the 016 * specific language governing permissions and limitations 017 * under the License. 018 * 019 */ 020 021package org.apache.directory.api.ldap.model.schema.normalizers; 022 023 024import org.apache.directory.api.ldap.model.schema.Normalizer; 025 026 027/** 028 * The OidNomalizer class contains a tuple: an OID with its Normalizer. It itself 029 * is not a normalizer. 030 * 031 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a> 032 */ 033public class OidNormalizer 034{ 035 /** The oid */ 036 private String attributeTypeOid; 037 038 /** The normalizer to be used with this OID */ 039 private Normalizer normalizer; 040 041 042 /** 043 * A constructor which accept two parameters 044 * 045 * @param attributeTypeOid the oid of the attributeType mapped to the normalizer 046 * @param normalizer the associated equality match based normalizer 047 */ 048 public OidNormalizer( String attributeTypeOid, Normalizer normalizer ) 049 { 050 this.attributeTypeOid = attributeTypeOid; 051 this.normalizer = normalizer; 052 } 053 054 055 /** 056 * A copy constructor. 057 * 058 * @param oidNormalizer the OidNormalizer to copy from 059 */ 060 public OidNormalizer( OidNormalizer oidNormalizer ) 061 { 062 attributeTypeOid = oidNormalizer.attributeTypeOid; 063 normalizer = oidNormalizer.normalizer; 064 } 065 066 067 /** 068 * Get the normalizer 069 * 070 * @return The normalizer associated to the current OID 071 */ 072 public Normalizer getNormalizer() 073 { 074 return normalizer; 075 } 076 077 078 /** 079 * Get the current name 080 * 081 * @return The current name 082 */ 083 public String getAttributeTypeOid() 084 { 085 return attributeTypeOid; 086 } 087 088 089 /** 090 * Return a String representation of this class 091 */ 092 @Override 093 public String toString() 094 { 095 return "OidNormalizer : { " + attributeTypeOid + ", " + normalizer.toString() + "}"; 096 } 097}