enum.valueOf(String name) missing from Javadoc 1.5 and 1.6
There is no method Enum.valueOf(String) However, every enum
has a values()
and valueOf(String)
method generated by the compiler and these are documented. They are static methods and thus cannot be overridden or defined in a super class or interface.
Enum e = Enum.valueOf(""); // this doesn't compile
http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Thread.State.html#values%28%29
http://docs.oracle.com/javase/6/docs/api/java/lang/Thread.State.html#values%28%29
Its the same in Java 5.0, 6 or 7.
For Java 5.0 http://docs.oracle.com/javase/specs/jls/se5.0/html/classes.html#8.9 (archive.org copy) (search for values) For Java 7 http://docs.oracle.com/javase/specs/jls/se7/html/jls-8.html#jls-8.9.2 provided by @kapep
Under the hood, enum.valueOf(String name)
is actually calling Enum.valueOf(Class<T> enumType, String name)