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
22  * terms of whether it is viewable in the final generated API.
23  */
24 enum class VisibilityLevel(
25     /** String representation in source code. */
26     val javaSourceCodeModifier: String,
27 
28     /** String representation in Kotlin source code. */
29     val kotlinSourceCodeModifier: String,
30 
31     /** String representation in user visible messages. */
32     val userVisibleDescription: String,
33     /** Representation in the internal flags. */
34     val visibilityFlagValue: Int
35 ) {
36     PACKAGE_PRIVATE("", "", "package private", DefaultModifierList.PACKAGE_PRIVATE),
37     PRIVATE("private", "private", "private", DefaultModifierList.PRIVATE),
38     INTERNAL("internal", "internal", "internal", DefaultModifierList.INTERNAL),
39     PROTECTED("protected", "protected", "protected", DefaultModifierList.PROTECTED),
40     PUBLIC("public", "", "public", DefaultModifierList.PUBLIC)
41 }
42