1 package fr.inrae.agroclim.indicators.exception.type;
2
3 import fr.inrae.agroclim.indicators.exception.ErrorCategory;
4 import fr.inrae.agroclim.indicators.exception.IndicatorsErrorCategory;
5 import fr.inrae.agroclim.indicators.model.data.ResourceManager;
6 import lombok.Getter;
7 import lombok.RequiredArgsConstructor;
8
9
10
11
12
13
14 @RequiredArgsConstructor
15 public enum ResourceErrorType implements CommonErrorType {
16
17
18
19
20
21 CLIMATE("100", null),
22
23
24
25
26
27 CLIMATE_EMPTY("110", CLIMATE),
28
29
30
31
32
33
34 CLIMATE_EMPTY_FOR_PHASE("111", CLIMATE_EMPTY),
35
36
37
38
39
40 CLIMATE_SIZE_WRONG("101", CLIMATE),
41
42
43
44
45
46 CLIMATE_YEARS("120", null),
47
48
49
50
51
52 CLIMATE_YEARS_EMPTY("121", CLIMATE_YEARS),
53
54
55
56
57
58 CLIMATE_YEARS_MISSING("122", CLIMATE_YEARS),
59
60
61
62
63
64 PHENO("200", null),
65
66
67
68
69
70 PHENO_EMPTY("201", PHENO),
71
72
73
74
75
76 PHENO_YEARS("210", PHENO),
77
78
79
80
81
82 PHENO_YEARS_EMPTY("211", PHENO_YEARS),
83
84
85
86
87
88 RESOURCES_CROPDEVELOPMENT_YEARS("001", null),
89
90
91
92
93
94 SOIL("300", null),
95
96
97
98
99
100 SOIL_SIZE_WRONG("301", SOIL),
101
102
103
104
105
106 VARIABLES("400", null),
107
108
109
110
111
112 VARIABLES_EMPTY("401", VARIABLES),
113
114
115
116
117
118 VARIABLES_MISSING("402", VARIABLES);
119
120
121
122 @Getter
123 private final String subCode;
124
125
126
127 @Getter
128 private final ResourceErrorType parent;
129
130 @Override
131 public ErrorCategory getCategory() {
132 return IndicatorsErrorCategory.RESOURCES;
133 }
134
135 }