Created
January 22, 2014 13:23
-
-
Save codebucketdev/8558628 to your computer and use it in GitHub Desktop.
Operators.java class of my MySQL System
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package de.codebucket.mysql; | |
import java.util.HashMap; | |
import java.util.Map; | |
public class Operators | |
{ | |
public enum DataTypes | |
{ | |
Text(1), Char(2), Int(3), Decimal(4), Float(5), Double(6), Boolean(7), Date(8), Time(9); | |
private static final Map<Integer, DataTypes> valueList; | |
private final int value; | |
static | |
{ | |
valueList = new HashMap<Integer, DataTypes>(); | |
for (DataTypes result : values()) | |
{ | |
valueList.put(Integer.valueOf(result.value), result); | |
} | |
} | |
private DataTypes(int value) | |
{ | |
this.value = value; | |
} | |
public int getValue() | |
{ | |
return this.value; | |
} | |
public static DataTypes getResult(int value) | |
{ | |
return (DataTypes) valueList.get(Integer.valueOf(value)); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment