• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2011 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.android.tools.lint.detector.api;
18 
19 import com.android.annotations.NonNull;
20 import com.google.common.annotations.Beta;
21 
22 /**
23  * Severity of an issue found by lint
24  * <p/>
25  * <b>NOTE: This is not a public or final API; if you rely on this be prepared
26  * to adjust your code for the next tools release.</b>
27  */
28 @Beta
29 public enum Severity {
30     /**
31      * Fatal: Use sparingly because a warning marked as fatal will be
32      * considered critical and will abort Export APK etc in ADT
33      */
34     FATAL("Fatal"),
35 
36     /**
37      * Errors: The issue is known to be a real error that must be addressed.
38      */
39     ERROR("Error"),
40 
41     /**
42      * Warning: Probably a problem.
43      */
44     WARNING("Warning"),
45 
46     /**
47      * Information only: Might not be a problem, but the check has found
48      * something interesting to say about the code.
49      */
50     INFORMATIONAL("Information"),
51 
52     /**
53      * Ignore: The user doesn't want to see this issue
54      */
55     IGNORE("Ignore");
56 
57     private String mDisplay;
58 
Severity(@onNull String display)59     private Severity(@NonNull String display) {
60         mDisplay = display;
61     }
62 
63     /**
64      * Returns a description of this severity suitable for display to the user
65      *
66      * @return a description of the severity
67      */
68     @NonNull
getDescription()69     public String getDescription() {
70         return mDisplay;
71     }
72 }