| Modifier and Type | Field and Description |
|---|---|
(package private) Converter<A,B> |
original |
private static long |
serialVersionUID |
| Constructor and Description |
|---|
ReverseConverter(Converter<A,B> original) |
| Modifier and Type | Method and Description |
|---|---|
(package private) B |
correctedDoBackward(A a) |
(package private) A |
correctedDoForward(B b) |
protected B |
doBackward(A a)
Returns a representation of
b as an instance of type A. |
protected A |
doForward(B b)
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() |
Converter<A,B> |
reverse()
Returns the reversed view of this converter, which converts
this.convert(a) back to a
value roughly equivalent to a. |
java.lang.String |
toString() |
andThen, apply, convert, convertAll, doAndThen, from, identityprivate static final long serialVersionUID
protected A doForward(B b)
Convertera as an instance of type B. If a cannot be
converted, an unchecked exception (such as IllegalArgumentException) should be thrown.protected B doBackward(A a)
Converterb as an instance of type A. If b cannot be
converted, an unchecked exception (such as IllegalArgumentException) should be thrown.doBackward in class Converter<B,A>a - the instance to convert; will never be nullB correctedDoBackward(A a)
correctedDoBackward in class Converter<B,A>public Converter<A,B> reverse()
Converterthis.convert(a) back to a
value roughly equivalent to a.
The returned converter is serializable if this converter is.
Note: you should not override this method. It is non-final for legacy reasons.
public boolean equals(java.lang.Object object)
ConverterMost 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.Objectpublic java.lang.String toString()
toString in class java.lang.Object