/*
 * Copyright (C) Baidu Inc. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.baidu.titan.dex;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhangdi07@baidu.com
 * @since 2018/3/12
 */
public class DexAnnotationVisibilitys {

    /** build */
    public static final int ANNOTATION_VISIBILITY_BUILD = 0x00;
    /** runtime */
    public static final int ANNOTATION_VISIBILITY_RUNTIME = 0x01;
    /** system */
    public static final int ANNOTATION_VISIBILITY_SYSTEM = 0x02;

    private static final List<DexAnnotationVisibility> sVisivilitys = new ArrayList<>();

    static {
        addToVisibility(ANNOTATION_VISIBILITY_BUILD, "build");
        addToVisibility(ANNOTATION_VISIBILITY_RUNTIME, "runtime");
        addToVisibility(ANNOTATION_VISIBILITY_SYSTEM, "system");
    }

    private static void addToVisibility(int value, String name) {
        sVisivilitys.add(new DexAnnotationVisibility(value, name));
    }

    public static DexAnnotationVisibility get(int visibility) {
        return sVisivilitys.get(visibility);
    }



}
