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   *    https://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 int hashCode()
62      {
63          int h = 37;
64  
65          h = h * 17 + ( ( language == null ) ? 0 : language.hashCode() );
66  
67          return h;
68      }
69  
70  
71      /**
72       * {@inheritDoc}
73       */
74      @Override
75      public boolean equals( Object obj )
76      {
77          if ( this == obj )
78          {
79              return true;
80          }
81          
82          if ( obj == null )
83          {
84              return false;
85          }
86          
87          if ( getClass() != obj.getClass() )
88          {
89              return false;
90          }
91          
92          StoredProcedureLanguageSchemeOption other = ( StoredProcedureLanguageSchemeOption ) obj;
93       
94          if ( language == null )
95          {
96              if ( other.language != null )
97              {
98                  return false;
99              }
100         }
101         else if ( !language.equals( other.language ) )
102         {
103             return false;
104         }
105         
106         return true;
107     }
108 
109 
110     /**
111      * {@inheritDoc}
112      */
113     @Override
114     public String toString()
115     {
116         return "language " + "\"" + language + "\"";
117     }
118 }