• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2019 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License
15  */
16 
17 package com.google.tuningfork.validation;
18 
19 /** Validation errors */
20 public enum ErrorType {
21   // Annotation field is empty
22   ANNOTATION_EMPTY(ErrorGroup.ANNOTATION),
23   // Annotation field is too complex - contains oneofs/nestedtypes/extensions
24   ANNOTATION_COMPLEX(ErrorGroup.ANNOTATION),
25   // Annotation must contains enums only
26   ANNOTATION_TYPE(ErrorGroup.ANNOTATION),
27   // FidelityParams fied is empty
28   FIDELITY_PARAMS_EMPTY(ErrorGroup.FIDELITY),
29   // FidelityParams field is complex - contains  oneof/nestedtypes/extensions
30   FIDELITY_PARAMS_COMPLEX(ErrorGroup.FIDELITY),
31   // FidelityParams can only contains float, int32 or enum
32   FIDELITY_PARAMS_TYPE(ErrorGroup.FIDELITY),
33   // Fidelity parameters are empty
34   DEV_FIDELITY_PARAMETERS_EMPTY(ErrorGroup.DEV_FIDELITY),
35   // Fidelity parameters parsing error
36   DEV_FIDELITY_PARAMETERS_PARSING(ErrorGroup.DEV_FIDELITY),
37   // Fidelity parameters encoding textproto file
38   DEV_FIDELITY_PARAMETERS_ENCODING(ErrorGroup.DEV_FIDELITY),
39   // Fidelity parameters reading file
40   DEV_FIDELITY_PARAMETERS_READING(ErrorGroup.DEV_FIDELITY),
41   // Parsing error
42   SETTINGS_PARSING(ErrorGroup.SETTINGS),
43   // Histogram field is empty
44   HISTOGRAM_EMPTY(ErrorGroup.SETTINGS),
45   // Aggreagtion field is empty
46   AGGREGATION_EMPTY(ErrorGroup.SETTINGS),
47   // Aggregation contains incorrect  max_instrumentation_keys field
48   AGGREGATION_INSTRUMENTATION_KEY(ErrorGroup.SETTINGS),
49   // Aggregation contains incorrect annotation_enum_sizes
50   AGGREGATION_ANNOTATIONS(ErrorGroup.SETTINGS);
51 
52   private final ErrorGroup group;
53 
getGroup()54   public ErrorGroup getGroup() {
55     return group;
56   }
57 
ErrorType(ErrorGroup group)58   ErrorType(ErrorGroup group) {
59     this.group = group;
60   }
61 
62   /** Validation group of errors */
63   public enum ErrorGroup {
64     ANNOTATION,
65     FIDELITY,
66     DEV_FIDELITY,
67     SETTINGS,
68   }
69 };
70