public static Object convert ( String constant , TypeKind kind ) { switch ( kind ) { case INT : return Integer . parseInt ( constant ) ; case LONG : return java . lang . Long . parseLong ( constant ) ; case FLOAT : return java . lang . Float . parseFloat ( constant ) ; case DOUBLE : return java . lang . Double . parseDouble ( constant ) ; default : throw new UnsupportedOperationException ( kind + "Not yet implemented" ) ; } }
Returns a Object of type type converted from constant