//
// https://www.ramecera.it/myscrewdriver.html
// e-mail: screwdriver@ramecera.it
//
/* 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 */
package it.ramecera.screwdriver.utilities;

/**
 * <p>
 * Creation date: 2020-04-09<br>
 * Last updated: 2020-04-09<br>
 * </p>
 * 
 * @author M.Maglioni */
public class ValidationLabelScrew {

	/**
	 * <p>
	 * Creation date: 2020-04-09<br>
	 * Last updated: 2020-04-09<br>
	 * </p>
	 * 
	 * @author M.Maglioni
	 * @param label validation label
	 * @param languageCodeIndex language code */
	public ValidationLabelScrew(String label, int languageCodeIndex) {
		super();
		this.label = label;
		this.languageCodeIndex = languageCodeIndex;
	}

	/** the message label */
	public String label;
	/** index in the list of language codes */
	public int languageCodeIndex;

	/**
	 * <p>
	 * Creation date: 2020-04-09<br>
	 * Last updated: 2020-04-09<br>
	 * </p>
	 * 
	 * @return the language code index */

	@Override
	public int hashCode() {
		return languageCodeIndex;
	}

	/**
	 * <p>
	 * Creation date: 2020-04-09<br>
	 * Last updated: 2020-04-09<br>
	 * </p>
	 * 
	 * @param o object to evaluate
	 * @return true if equal, false if not equal */
	@Override
	public boolean equals(Object o) {
		if (o == null) {
			return false;
		}
		if (o == this) {
			return true;
		}
		if (!(o instanceof ValidationLabelScrew)) {
			return false;
		}
		ValidationLabelScrew vl = (ValidationLabelScrew) o;
		return vl.label.equals(label)
				& vl.languageCodeIndex == languageCodeIndex;
	}

}
