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.trigger;
22  
23  
24  /**
25   * The language schema option of triggered stored procedure.
26   * 
27   * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
28   */
29  public class StoredProcedureLanguageSchemeOption implements StoredProcedureOption
30  {
31  
32      private String language;
33  
34  
35      /**
36       * Instantiates a new stored procedure language scheme option.
37       *
38       * @param language the language
39       */
40      public StoredProcedureLanguageSchemeOption( String language )
41      {
42          this.language = language;
43      }
44  
45  
46      /**
47       * Gets the language.
48       *
49       * @return the language
50       */
51      public String getLanguage()
52      {
53          return language;
54      }
55  
56  
57      /**
58       * {@inheritDoc}
59       */
60      @Override
61      public String toString()
62      {
63          return "language " + "\"" + language + "\"";
64      }
65  
66  
67      /**
68       * {@inheritDoc}
69       */
70      @Override
71      public int hashCode()
72      {
73          int h = 37;
74  
75          h = h * 17 + ( ( language == null ) ? 0 : language.hashCode() );
76  
77          return h;
78      }
79  
80  
81      /**
82       * {@inheritDoc}
83       */
84      @Override
85      public boolean equals( Object obj )
86      {
87          if ( this == obj )
88          {
89              return true;
90          }
91          if ( obj == null )
92          {
93              return false;
94          }
95          if ( getClass() != obj.getClass() )
96          {
97              return false;
98          }
99          final StoredProcedureLanguageSchemeOption other = ( StoredProcedureLanguageSchemeOption ) obj;
100         if ( language == null )
101         {
102             if ( other.language != null )
103             {
104                 return false;
105             }
106         }
107         else if ( !language.equals( other.language ) )
108         {
109             return false;
110         }
111         return true;
112     }
113 
114 }