Modifier and Type | Field and Description |
---|---|
private BiMap<A,B> |
bimap |
private static long |
serialVersionUID |
Constructor and Description |
---|
BiMapConverter(BiMap<A,B> bimap) |
Modifier and Type | Method and Description |
---|---|
private static <X,Y> Y |
convert(BiMap<X,Y> bimap,
X input) |
protected A |
doBackward(B b)
Returns a representation of
b as an instance of type A . |
protected B |
doForward(A a)
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, from, identity, reverse
private static final long serialVersionUID
protected B doForward(A a)
Converter
a
as an instance of type B
. If a
cannot be
converted, an unchecked exception (such as IllegalArgumentException
) should be thrown.protected A doBackward(B b)
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<A,B>
b
- the instance to convert; will never be nullprivate static <X,Y> Y convert(BiMap<X,Y> bimap, X input)
public 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