blob: b205191a62231894e218ae3e33a031d68caa26f3 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2009 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Boris Bokowski, IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.e4.ui.internal.gadgets.opensocial;
class LocaleKey {
String language;
String country;
public LocaleKey(String language, String country) {
this.language = language;
this.country = country;
}
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result
+ ((country == null) ? 0 : country.hashCode());
result = prime * result
+ ((language == null) ? 0 : language.hashCode());
return result;
}
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
LocaleKey other = (LocaleKey) obj;
if (country == null) {
if (other.country != null)
return false;
} else if (!country.equals(other.country))
return false;
if (language == null) {
if (other.language != null)
return false;
} else if (!language.equals(other.language))
return false;
return true;
}
}