001 /* 002 * Licensed to the Apache Software Foundation (ASF) under one 003 * or more contributor license agreements. See the NOTICE file 004 * distributed with this work for additional information 005 * regarding copyright ownership. The ASF licenses this file 006 * to you under the Apache License, Version 2.0 (the 007 * "License"); you may not use this file except in compliance 008 * with the License. You may obtain a copy of the License at 009 * 010 * http://www.apache.org/licenses/LICENSE-2.0 011 * 012 * Unless required by applicable law or agreed to in writing, 013 * software distributed under the License is distributed on an 014 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 015 * KIND, either express or implied. See the License for the 016 * specific language governing permissions and limitations 017 * under the License. 018 */ 019 020 // 021 // This source code implements specifications defined by the Java 022 // Community Process. In order to remain compliant with the specification 023 // DO NOT add / change / or delete method signatures! 024 // 025 026 package javax.enterprise.deploy.shared; 027 028 /** 029 * Class DConfigBeanVersionTypes defines enumeration values for the J2EE 030 * Platform verion number. 031 * 032 * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Mi, 25. Okt 2006) $ 033 */ 034 public class DConfigBeanVersionType { 035 /** 036 * J2EE Platform version 1.3 037 */ 038 public static final DConfigBeanVersionType V1_3 = new DConfigBeanVersionType(0); 039 /** 040 * J2EE Platform version 1.3.1 041 */ 042 public static final DConfigBeanVersionType V1_3_1 = new DConfigBeanVersionType(1); 043 /** 044 * J2EE Platform version 1.4 045 */ 046 public static final DConfigBeanVersionType V1_4 = new DConfigBeanVersionType(2); 047 048 private static final DConfigBeanVersionType[] enumValueTable = { 049 V1_3, 050 V1_3_1, 051 V1_4, 052 }; 053 054 private static final String[] stringTable = { 055 "V1_3", 056 "V1_3_1", 057 "V1_4", 058 }; 059 060 private int value; 061 062 /** 063 * Construct a new enumeration value with the given integer value. 064 */ 065 protected DConfigBeanVersionType(int value) { 066 this.value = value; 067 } 068 069 /** 070 * Returns this enumeration value's integer value. 071 */ 072 public int getValue() { 073 return value; 074 } 075 076 /** 077 * Returns the string table for class DConfigBeanVersionType 078 */ 079 protected String[] getStringTable() { 080 return stringTable; 081 } 082 083 /** 084 * Returns the enumeration value table for class DConfigBeanVersionType 085 */ 086 protected DConfigBeanVersionType[] getEnumValueTable() { 087 return enumValueTable; 088 } 089 090 /** 091 * Return an object of the specified value. 092 * 093 * @param value a designator for the object. 094 */ 095 public static DConfigBeanVersionType getDConfigBeanVersionType(int value) { 096 return enumValueTable[value]; 097 } 098 099 /** 100 * Return the string name of this DConfigBeanVersionType or the integer 101 * value if outside the bounds of the table 102 */ 103 public String toString() { 104 return (value >= 0 && value <= 2) ? getStringTable()[value] : String.valueOf(value); 105 } 106 107 /** 108 * Returns the lowest integer value used by this enumeration value's 109 * enumeration class. 110 * 111 * @return the offset of the lowest enumeration value. 112 */ 113 protected int getOffset() { 114 return 0; 115 } 116 }