Modifier and Type | Field and Description |
---|---|
private java.lang.Class<T> |
enumClass |
private static long |
serialVersionUID |
Constructor and Description |
---|
StringConverter(java.lang.Class<T> enumClass) |
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
doBackward(T enumValue)
Returns a representation of
b as an instance of type A . |
protected T |
doForward(java.lang.String value)
Returns a representation of
a as an instance of type B . |
boolean |
equals(java.lang.Object object)
Indicates whether another object is equal to this converter.
|
int |
hashCode() |
java.lang.String |
toString() |
andThen, apply, convert, convertAll, correctedDoBackward, correctedDoForward, doAndThen, from, identity, reverse
private static final long serialVersionUID
StringConverter(java.lang.Class<T> enumClass)
protected T doForward(java.lang.String value)
Converter
a
as an instance of type B
. If a
cannot be
converted, an unchecked exception (such as IllegalArgumentException
) should be thrown.protected java.lang.String doBackward(T enumValue)
Converter
b
as an instance of type A
. If b
cannot be
converted, an unchecked exception (such as IllegalArgumentException
) should be thrown.doBackward
in class Converter<java.lang.String,T extends java.lang.Enum<T>>
enumValue
- the instance to convert; will never be nullpublic boolean equals(@CheckForNull java.lang.Object object)
Converter
Most implementations will have no reason to override the behavior of Object.equals(java.lang.Object)
.
However, an implementation may also choose to return true
whenever object
is a
Converter
that it considers interchangeable with this one. "Interchangeable"
typically means that Objects.equal(this.convert(a), that.convert(a))
is true for
all a
of type A
(and similarly for reverse
). Note that a false
result from this method does not imply that the converters are known not to be
interchangeable.
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object