/*-
 *  Copyright 2020 Beuth Hochschule für Technik Berlin, Hochschule für Technik Stuttgart
 * 
 *  This file is part of CityDoctor2.
 *
 *  CityDoctor2 is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU Lesser General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  CityDoctor2 is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY); without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public License
 *  along with CityDoctor2.  If not, see <https://www.gnu.org/licenses/>.
 */
package de.hft.stuttgart.citydoctor2.check;

import java.io.Serializable;

public class CheckId implements Serializable {

	private static final long serialVersionUID = -6267337828874296004L;
	
	public static final CheckId C_GE_R_TOO_FEW_POINTS = new CheckId("C_GE_R_TOO_FEW_POINTS");
	public static final CheckId C_GE_R_NOT_CLOSED = new CheckId("C_GE_R_NOT_CLOSED");
	public static final CheckId C_GE_S_MULTIPLE_CONNECTED_COMPONENTS = new CheckId(
			"C_GE_S_MULTIPLE_CONNECTED_COMPONENTS");
	public static final CheckId C_GE_R_DUPLICATE_POINT = new CheckId("C_GE_R_DUPLICATE_POINT");
	public static final CheckId C_GE_R_SELF_INTERSECTION = new CheckId("C_GE_R_SELF_INTERSECTION");
	public static final CheckId C_GE_P_INTERIOR_DISCONNECTED = new CheckId("C_GE_P_INTERIOR_DISCONNECTED");
	public static final CheckId C_GE_P_INTERSECTING_RINGS = new CheckId("C_GE_P_INTERSECTING_RINGS");
	public static final CheckId C_GE_P_NON_PLANAR = new CheckId("C_GE_P_NON_PLANAR");
	public static final CheckId C_GE_S_TOO_FEW_POLYGONS = new CheckId("C_GE_S_TOO_FEW_POLYGONS");
	public static final CheckId C_GE_R_NULL_AREA = new CheckId("C_GE_R_NULL_AREA");
	public static final CheckId C_GE_S_NON_MANIFOLD_EDGE = new CheckId("C_GE_S_NON_MANIFOLD_EDGE");
	public static final CheckId C_GE_S_POLYGON_WRONG_ORIENTATION = new CheckId("C_GE_S_POLYGON_WRONG_ORIENTATION");
	public static final CheckId C_GE_S_ALL_POLYGONS_WRONG_ORIENTATION = new CheckId(
			"C_GE_S_ALL_POLYGONS_WRONG_ORIENTATION");
	public static final CheckId C_GE_S_NON_MANIFOLD_VERTEX = new CheckId("C_GE_S_NON_MANIFOLD_VERTEX");
	public static final CheckId C_GE_S_SELF_INTERSECTION = new CheckId("C_GE_S_SELF_INTERSECTION");
	public static final CheckId C_GE_P_HOLE_OUTSIDE = new CheckId("C_GE_P_HOLE_OUTSIDE");
	public static final CheckId IS_CEILING = new CheckId("IS_CEILING");
	public static final CheckId C_GE_P_INNER_RINGS_NESTED = new CheckId("C_GE_P_INNER_RINGS_NESTED");
	public static final CheckId C_SEM_BS_NOT_CEILING = new CheckId("C_SEM_BS_NOT_CEILING");
	public static final CheckId C_SEM_BS_NOT_FLOOR = new CheckId("C_SEM_BS_NOT_FLOOR");
	public static final CheckId C_SEM_BS_NOT_GROUND = new CheckId("C_SEM_BS_NOT_GROUND");
	public static final CheckId C_SEM_F_MISSING_ID = new CheckId("C_SEM_F_MISSING_ID");
	public static final CheckId C_SEM_BS_GROUND_NOT_FRAGMENTED = new CheckId("C_SEM_BS_GROUND_NOT_FRAGMENTED");
	public static final CheckId C_SEM_BS_IS_WALL = new CheckId("C_SEM_BS_IS_WALL");
	public static final CheckId C_SEM_SCHEMATRON = new CheckId("C_SEM_SCHEMATRON");
	public static final CheckId C_SEM_BS_ROOF_NOT_FRAGMENTED = new CheckId("C_SEM_BS_ROOF_NOT_FRAGMENTED");
	public static final CheckId C_GE_S_NOT_CLOSED = new CheckId("C_GE_S_NOT_CLOSED");
	public static final CheckId C_GE_P_ORIENTATION_RINGS_SAME = new CheckId("C_GE_P_ORIENTATION_RINGS_SAME");
	
	private String name;

	public CheckId(String name) {
		this.name = name;
	}
	
	public String getName() {
		return name;
	}
	
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((name == null) ? 0 : name.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		CheckId other = (CheckId) obj;
		if (name == null) {
			if (other.name != null)
				return false;
		} else if (!name.equals(other.name))
			return false;
		return true;
	}

	@Override
	public String toString() {
		return name;
	}

}
