public class EnumFormatter<T extends java.lang.Enum<T>> extends java.lang.Object implements IFormatter<T>, java.io.Serializable
IFormatter
suitable for enum to string conversions.Constructor and Description |
---|
EnumFormatter(java.lang.Class<T> clazz) |
public EnumFormatter(java.lang.Class<T> clazz)
public java.lang.String format(T value)
format
in interface IFormatter<T extends java.lang.Enum<T>>
public java.lang.Class<T> getValueType()
getValueType
in interface IFormatter<T extends java.lang.Enum<T>>
public T cast(T value)
cast
in interface IFormatter<T extends java.lang.Enum<T>>
value
- a not null valueIFormatter.getValueType()
(or one of its subclasses).public T parse(java.lang.String text) throws java.text.ParseException
parse
in interface IFormatter<T extends java.lang.Enum<T>>
IFormatter.getValueType()
(or one of its subclasses).java.text.ParseException
- - if the text cannot be converted to an object
instance.public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object