private static final class Converter.IdentityConverter<T> extends Converter<T,T> implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
(package private) static Converter.IdentityConverter<?> |
INSTANCE |
private static long |
serialVersionUID |
Modifier | Constructor and Description |
---|---|
private |
IdentityConverter() |
Modifier and Type | Method and Description |
---|---|
(package private) <S> Converter<T,S> |
doAndThen(Converter<T,S> otherConverter)
Package-private non-final implementation of andThen() so only we can override it.
|
protected T |
doBackward(T t)
Returns a representation of
b as an instance of type A . |
protected T |
doForward(T t)
Returns a representation of
a as an instance of type B . |
private java.lang.Object |
readResolve() |
Converter.IdentityConverter<T> |
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, correctedDoBackward, correctedDoForward, equals, from, identity
static final Converter.IdentityConverter<?> INSTANCE
private static final long serialVersionUID
protected T doForward(T t)
Converter
a
as an instance of type B
. If a
cannot be
converted, an unchecked exception (such as IllegalArgumentException
) should be thrown.protected T doBackward(T t)
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<T,T>
t
- the instance to convert; will never be nullpublic Converter.IdentityConverter<T> reverse()
Converter
this.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.
<S> Converter<T,S> doAndThen(Converter<T,S> otherConverter)
Converter
public java.lang.String toString()
toString
in class java.lang.Object
private java.lang.Object readResolve()