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 package com.android.tools.metalava.model
17 
18 /**
19  * The visibility levels for classes and class members.
20  *
21  * <p>The order is significant. It is from least visible to most visible, where visibility is in terms of whether it
22  * is viewable in the final generated API.
23  */
24 enum class VisibilityLevel(
25     /**
26      * String representation in source code.
27      */
28     val sourceCodeModifier: String,
29 
30     /**
31      * String representation in user visible messages.
32      */
33     val userVisibleDescription: String,
34     /**
35      * Representation in the internal flags.
36      */
37     val visibilityFlagValue: Int
38 ) {
39     PRIVATE("private", "private", DefaultModifierList.PRIVATE),
40     INTERNAL("internal", "internal", DefaultModifierList.INTERNAL),
41     PACKAGE_PRIVATE("", "package private", DefaultModifierList.PACKAGE_PRIVATE),
42     PROTECTED("protected", "protected", DefaultModifierList.PROTECTED),
43     PUBLIC("public", "public", DefaultModifierList.PUBLIC)
44 }
45