001    /*
002     * Copyright 2010-2013 JetBrains s.r.o.
003     *
004     * Licensed under the Apache License, Version 2.0 (the "License");
005     * you may not use this file except in compliance with the License.
006     * You may obtain a copy of the License at
007     *
008     * http://www.apache.org/licenses/LICENSE-2.0
009     *
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS,
012     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013     * See the License for the specific language governing permissions and
014     * limitations under the License.
015     */
016    
017    package org.jetbrains.jet.lang.resolve.kotlin.header;
018    
019    import org.jetbrains.annotations.NotNull;
020    import org.jetbrains.annotations.Nullable;
021    
022    public class KotlinClassHeader {
023    
024        public enum Kind {
025            CLASS,
026            PACKAGE_FACADE,
027            SYNTHETIC_CLASS,
028            INCOMPATIBLE_ABI_VERSION
029        }
030    
031        private final Kind kind;
032        private final int version;
033        private final String[] data;
034    
035        public KotlinClassHeader(@NotNull Kind kind, int version, @Nullable String[] annotationData) {
036            assert (annotationData == null) == (kind != Kind.CLASS && kind != Kind.PACKAGE_FACADE)
037                    : "Annotation data should be not null only for CLASS and PACKAGE_FACADE";
038            this.kind = kind;
039            this.version = version;
040            this.data = annotationData;
041        }
042    
043        @NotNull
044        public Kind getKind() {
045            return kind;
046        }
047    
048        public int getVersion() {
049            return version;
050        }
051    
052        @Nullable
053        public String[] getAnnotationData() {
054            return data;
055        }
056    }