View Javadoc
1   /*
2    *  Licensed to the Apache Software Foundation (ASF) under one
3    *  or more contributor license agreements.  See the NOTICE file
4    *  distributed with this work for additional information
5    *  regarding copyright ownership.  The ASF licenses this file
6    *  to you under the Apache License, Version 2.0 (the
7    *  "License"); you may not use this file except in compliance
8    *  with the License.  You may obtain a copy of the License at
9    *  
10   *    http://www.apache.org/licenses/LICENSE-2.0
11   *  
12   *  Unless required by applicable law or agreed to in writing,
13   *  software distributed under the License is distributed on an
14   *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   *  KIND, either express or implied.  See the License for the
16   *  specific language governing permissions and limitations
17   *  under the License. 
18   *  
19   */
20  
21  package org.apache.directory.api.ldap.model.schema.normalizers;
22  
23  
24  import org.apache.directory.api.ldap.model.schema.Normalizer;
25  
26  
27  /**
28   * The OidNomalizer class contains a tuple: an OID with its Normalizer.  It itself
29   * is not a normalizer.
30   * 
31   * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
32   */
33  public class OidNormalizer
34  {
35      /** The oid */
36      private String attributeTypeOid;
37  
38      /** The normalizer to be used with this OID */
39      private Normalizer normalizer;
40  
41  
42      /**
43       * A constructor which accept two parameters
44       * 
45       * @param attributeTypeOid the oid of the attributeType mapped to the normalizer
46       * @param normalizer the associated equality match based normalizer
47       */
48      public OidNormalizer( String attributeTypeOid, Normalizer normalizer )
49      {
50          this.attributeTypeOid = attributeTypeOid;
51          this.normalizer = normalizer;
52      }
53  
54  
55      /**
56       * A copy constructor.
57       * 
58       * @param oidNormalizer the OidNormalizer to copy from
59       */
60      public OidNormalizer( OidNormalizer oidNormalizer )
61      {
62          attributeTypeOid = oidNormalizer.attributeTypeOid;
63          normalizer = oidNormalizer.normalizer;
64      }
65  
66  
67      /**
68       * Get the normalizer
69       * 
70       * @return The normalizer associated to the current OID
71       */
72      public Normalizer getNormalizer()
73      {
74          return normalizer;
75      }
76  
77  
78      /**
79       * Get the current name
80       * 
81       * @return The current name
82       */
83      public String getAttributeTypeOid()
84      {
85          return attributeTypeOid;
86      }
87  
88  
89      /**
90       * Return a String representation of this class
91       */
92      @Override
93      public String toString()
94      {
95          return "OidNormalizer : { " + attributeTypeOid + ", " + normalizer.toString() + "}";
96      }
97  }