ErrorId.java 4.48 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/*-
 *  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;

Matthias Betz's avatar
Matthias Betz committed
21
22
import java.io.Serializable;

23
24
25
26
27
28
29
/**
 * The error ids of all checks and their respective name, which is used in
 * reports and GUI
 * 
 * @author Matthias Betz
 *
 */
Matthias Betz's avatar
Matthias Betz committed
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
public class ErrorId implements Serializable {
	
	private static final long serialVersionUID = -2598466667746276560L;
	
	public static final ErrorId DEPENDENCIES_NOT_MET = new ErrorId("Dependencies_not_met");
	public static final ErrorId UNKNOWN_ERROR = new ErrorId("Unknown_error");
	public static final ErrorId GE_R_NOT_CLOSED = new ErrorId("GE_R_NOT_CLOSED");
	public static final ErrorId GE_S_MULTIPLE_CONNECTED_COMPONENTS = new ErrorId("GE_S_MULTIPLE_CONNECTED_COMPONENTS");
	public static final ErrorId GE_R_CONSECUTIVE_POINTS_SAME = new ErrorId("GE_R_CONSECUTIVE_POINTS_SAME");
	public static final ErrorId GE_R_SELF_INTERSECTION = new ErrorId("GE_R_SELF_INTERSECTION");
	public static final ErrorId GE_S_POLYGON_WRONG_ORIENTATION = new ErrorId("GE_S_POLYGON_WRONG_ORIENTATION");
	public static final ErrorId GE_S_ALL_POLYGONS_WRONG_ORIENTATION = new ErrorId(
			"GE_S_ALL_POLYGONS_WRONG_ORIENTATION");
	public static final ErrorId GE_P_HOLE_OUTSIDE = new ErrorId("GE_P_HOLE_OUTSIDE");
	public static final ErrorId GE_P_INTERIOR_DISCONNECTED = new ErrorId("GE_P_INTERIOR_DISCONNECTED");
	public static final ErrorId GE_S_NON_MANIFOLD_VERTEX = new ErrorId("GE_S_NON_MANIFOLD_VERTEX");
	public static final ErrorId GE_P_INNER_RINGS_NESTED = new ErrorId("GE_P_INNER_RINGS_NESTED");
	public static final ErrorId GE_R_NULL_AREA = new ErrorId("GE_R_NULL_AREA");
	public static final ErrorId GE_R_TOO_FEW_POINTS = new ErrorId("GE_R_TOO_FEW_POINTS");
	public static final ErrorId GE_S_NON_MANIFOLD_EDGE = new ErrorId("GE_S_NON_MANIFOLD_EDGE");
	public static final ErrorId GE_P_NON_PLANAR_POLYGON_NORMALS_DEVIATION = new ErrorId(
			"GE_P_NON_PLANAR_POLYGON_NORMALS_DEVIATION");
	public static final ErrorId GE_P_NON_PLANAR_POLYGON_DISTANCE_PLANE = new ErrorId(
			"GE_P_NON_PLANAR_POLYGON_DISTANCE_PLANE");
	public static final ErrorId GE_P_INTERSECTING_RINGS = new ErrorId("GE_P_INTERSECTING_RINGS");
	public static final ErrorId GE_S_SELF_INTERSECTION = new ErrorId("GE_S_SELF_INTERSECTION");
	public static final ErrorId GE_P_ORIENTATION_RINGS_SAME = new ErrorId("GE_P_ORIENTATION_RINGS_SAME");
	public static final ErrorId GE_S_NOT_CLOSED = new ErrorId("GE_S_NOT_CLOSED");
	public static final ErrorId GE_S_TOO_FEW_POLYGONS = new ErrorId("GE_S_TOO_FEW_POLYGONS");
59
60
61
62
63
64
	public static final ErrorId SE_BS_NOT_CEILING = new ErrorId("SE_BS_NOT_CEILING");
	public static final ErrorId SE_BS_NOT_WALL = new ErrorId("SE_BS_NOT_WALL");
	public static final ErrorId SE_BS_NOT_FLOOR = new ErrorId("SE_BS_NOT_FLOOR");
	public static final ErrorId SE_BS_NOT_GROUND = new ErrorId("SE_BS_NOT_GROUND");
	public static final ErrorId SE_SCHEMATRON_ERROR = new ErrorId("SE_SCHEMATRON_ERROR");
	public static final ErrorId SE_BS_UNFRAGMENTED = new ErrorId("SE_BS_UNFRAGMENTED");
Matthias Betz's avatar
Matthias Betz committed
65
	public static final ErrorId GE_P_DEGENERATED_POLYGON = new ErrorId("GE_P_DEGENERATED_POLYGON");
66
67
68

	private String name;

Matthias Betz's avatar
Matthias Betz committed
69
	public ErrorId(String name) {
70
71
72
		this.name = name;
	}

Matthias Betz's avatar
Matthias Betz committed
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
	@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;
		ErrorId other = (ErrorId) obj;
		if (name == null) {
			if (other.name != null)
				return false;
		} else if (!name.equals(other.name))
			return false;
		return true;
	}

98
99
100
101
102
	@Override
	public String toString() {
		return name;
	}

103
104
105
106
	public String getIdString() {
		return name;
	}

107
}