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
021 package org.apache.directory.shared.ldap.trigger;
022
023
024 /**
025 *
026 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
027 * @version $Rev:$, $Date:$
028 */
029 public class StoredProcedureLanguageSchemeOption implements StoredProcedureOption
030 {
031
032 private String language;
033
034 public StoredProcedureLanguageSchemeOption( String language )
035 {
036 this.language = language;
037 }
038
039 public String getLanguage()
040 {
041 return language;
042 }
043
044
045 /* (non-Javadoc)
046 * @see java.lang.Object#toString()
047 */
048 public String toString()
049 {
050 return "language " + "\"" + language + "\"";
051 }
052
053 /**
054 * @see java.lang.Object#hashCode()
055 * @return the instance's hash code
056 */
057 public int hashCode()
058 {
059 int h = 37;
060
061 h = h*17 + ( ( language == null ) ? 0 : language.hashCode() );
062
063 return h;
064 }
065
066 /* (non-Javadoc)
067 * @see java.lang.Object#equals(java.lang.Object)
068 */
069 public boolean equals( Object obj )
070 {
071 if ( this == obj )
072 return true;
073 if ( obj == null )
074 return false;
075 if ( getClass() != obj.getClass() )
076 return false;
077 final StoredProcedureLanguageSchemeOption other = ( StoredProcedureLanguageSchemeOption ) obj;
078 if ( language == null )
079 {
080 if ( other.language != null )
081 return false;
082 }
083 else if ( !language.equals( other.language ) )
084 return false;
085 return true;
086 }
087
088 }