Package com.google.common.base
Class Converter.FunctionBasedConverter<A,B>
java.lang.Object
com.google.common.base.Converter<A,B>
com.google.common.base.Converter.FunctionBasedConverter<A,B>
- All Implemented Interfaces:
Function<A,,B> Serializable,Function<A,B>
private static final class Converter.FunctionBasedConverter<A,B>
extends Converter<A,B>
implements Serializable
-
Field Summary
FieldsModifier and TypeFieldDescription -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class com.google.common.base.Converter
andThen, apply, convert, convertAll, correctedDoBackward, correctedDoForward, doAndThen, from, identity, reverse
-
Field Details
-
forwardFunction
-
backwardFunction
-
-
Constructor Details
-
FunctionBasedConverter
-
-
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<A,B> - Parameters:
b- the instance to convert; will never be null- Returns:
- the converted instance; must not be null
-
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
-