| 1 |
|
package net.sf.sapjcosupport; |
| 2 |
|
|
| 3 |
|
import org.apache.commons.lang.enums.Enum; |
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
public class SapType extends Enum { |
| 10 |
0 |
public static final SapType String = new SapType("String"); |
| 11 |
0 |
public static final SapType Double = new SapType("Double"); |
| 12 |
0 |
public static final SapType Int = new SapType("Int"); |
| 13 |
0 |
public static final SapType Date = new SapType("Date"); |
| 14 |
|
|
| 15 |
|
private SapType(String string) { |
| 16 |
0 |
super(string); |
| 17 |
0 |
} |
| 18 |
|
|
| 19 |
|
public static SapType getEnum(String name){ |
| 20 |
0 |
return (SapType) getEnumMap(SapType.class).get(decentName(name)); |
| 21 |
|
} |
| 22 |
|
|
| 23 |
|
private static String decentName(String name){ |
| 24 |
0 |
return new StringBuffer(name.substring(0,1).toUpperCase()).append(name.substring(1).toLowerCase()).toString(); |
| 25 |
|
} |
| 26 |
|
} |