Package com.google.common.base
Class Converter.ReverseConverter<A,B>
java.lang.Object
com.google.common.base.Converter<B,A>
com.google.common.base.Converter.ReverseConverter<A,B>
- All Implemented Interfaces:
Function<B,,A> Serializable,Function<B,A>
private static final class Converter.ReverseConverter<A,B>
extends Converter<B,A>
implements Serializable
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final long -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) B(package private) Aprotected BdoBackward(A a) Returns a representation ofbas an instance of typeA.protected AReturns a representation ofaas an instance of typeB.booleanIndicates whether another object is equal to this converter.inthashCode()reverse()Returns the reversed view of this converter, which convertsthis.convert(a)back to a value roughly equivalent toa.toString()Methods inherited from class com.google.common.base.Converter
andThen, apply, convert, convertAll, doAndThen, from, identity
-
Field Details
-
original
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
-
Constructor Details
-
ReverseConverter
-
-
Method Details
-
doForward
Description copied from class:ConverterReturns a representation ofaas an instance of typeB. Ifacannot be converted, an unchecked exception (such asIllegalArgumentException) should be thrown. -
doBackward
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<B,A> - Parameters:
a- the instance to convert; will never be null- Returns:
- the converted instance; must not be null
-
correctedDoForward
- Overrides:
correctedDoForwardin classConverter<B,A>
-
correctedDoBackward
- Overrides:
correctedDoBackwardin classConverter<B,A>
-
reverse
Description copied from class:ConverterReturns the reversed view of this converter, which convertsthis.convert(a)back to a value roughly equivalent toa.The returned converter is serializable if
thisconverter is.Note: you should not override this method. It is non-final for legacy reasons.
-
equals
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() -
toString
-