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.java;
018    
019    import org.jetbrains.annotations.NotNull;
020    import org.jetbrains.jet.lang.resolve.name.FqName;
021    import org.jetbrains.jet.lang.types.lang.PrimitiveType;
022    
023    public enum JvmPrimitiveType {
024        BOOLEAN(PrimitiveType.BOOLEAN, "boolean", "java.lang.Boolean"),
025        CHAR(PrimitiveType.CHAR, "char", "java.lang.Character"),
026        BYTE(PrimitiveType.BYTE, "byte", "java.lang.Byte"),
027        SHORT(PrimitiveType.SHORT, "short", "java.lang.Short"),
028        INT(PrimitiveType.INT, "int", "java.lang.Integer"),
029        FLOAT(PrimitiveType.FLOAT, "float", "java.lang.Float"),
030        LONG(PrimitiveType.LONG, "long", "java.lang.Long"),
031        DOUBLE(PrimitiveType.DOUBLE, "double", "java.lang.Double"),
032        ;
033        
034        private final PrimitiveType primitiveType;
035        private final String name;
036        private final FqName wrapperFqName;
037    
038        private JvmPrimitiveType(@NotNull PrimitiveType primitiveType, @NotNull String name, @NotNull String wrapperClassName) {
039            this.primitiveType = primitiveType;
040            this.name = name;
041            this.wrapperFqName = new FqName(wrapperClassName);
042        }
043    
044        @NotNull
045        public PrimitiveType getPrimitiveType() {
046            return primitiveType;
047        }
048    
049        @NotNull
050        public String getName() {
051            return name;
052        }
053    
054        @NotNull
055        public FqName getWrapperFqName() {
056            return wrapperFqName;
057        }
058    }