Package com.google.common.collect
Class Maps.BiMapConverter<A,B>
- java.lang.Object
-
- com.google.common.base.Converter<A,B>
-
- com.google.common.collect.Maps.BiMapConverter<A,B>
-
-
Field Summary
Fields Modifier and Type Field Description private BiMap<A,B>bimapprivate static longserialVersionUID
-
Constructor Summary
Constructors Constructor Description BiMapConverter(BiMap<A,B> bimap)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static <X,Y>
Yconvert(BiMap<X,Y> bimap, X input)protected AdoBackward(B b)Returns a representation ofbas an instance of typeA.protected BdoForward(A a)Returns a representation ofaas an instance of typeB.booleanequals(java.lang.Object object)Indicates whether another object is equal to this converter.inthashCode()java.lang.StringtoString()-
Methods inherited from class com.google.common.base.Converter
andThen, apply, convert, convertAll, from, identity, reverse
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
-
Method Detail
-
doForward
protected B doForward(A a)
Description copied from class:ConverterReturns a representation ofaas an instance of typeB. Ifacannot be converted, an unchecked exception (such asIllegalArgumentException) should be thrown.
-
doBackward
protected A doBackward(B b)
Description copied from class:ConverterReturns a representation ofbas an instance of typeA. Ifbcannot be converted, an unchecked exception (such asIllegalArgumentException) should be thrown.- Specified by:
doBackwardin classConverter<A,B>- Parameters:
b- the instance to convert; will never be null- Returns:
- the converted instance; must not be null
-
convert
private static <X,Y> Y convert(BiMap<X,Y> bimap, X input)
-
equals
public boolean equals(java.lang.Object object)
Description copied from class:ConverterIndicates whether another object is equal to this converter.Most implementations will have no reason to override the behavior of
Object.equals(java.lang.Object). However, an implementation may also choose to returntruewheneverobjectis aConverterthat it considers interchangeable with this one. "Interchangeable" typically means thatObjects.equal(this.convert(a), that.convert(a))is true for allaof typeA(and similarly forreverse). Note that afalseresult from this method does not imply that the converters are known not to be interchangeable.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-