Class Converter.ConverterComposition<A,B,C>

java.lang.Object
com.google.common.base.Converter<A,C>
com.google.common.base.Converter.ConverterComposition<A,B,C>
All Implemented Interfaces:
Function<A,C>, Serializable, Function<A,C>
Enclosing class:
Converter<A,B>

private static final class Converter.ConverterComposition<A,B,C> extends Converter<A,C> implements Serializable
  • Field Details

  • Constructor Details

  • Method Details

    • doForward

      protected C doForward(A a)
      Description copied from class: Converter
      Returns a representation of a as an instance of type B. If a cannot be converted, an unchecked exception (such as IllegalArgumentException) should be thrown.
      Specified by:
      doForward in class Converter<A,C>
      Parameters:
      a - the instance to convert; will never be null
      Returns:
      the converted instance; must not be null
    • doBackward

      protected A doBackward(C c)
      Description copied from class: Converter
      Returns a representation of b as an instance of type A. If b cannot be converted, an unchecked exception (such as IllegalArgumentException) should be thrown.
      Specified by:
      doBackward in class Converter<A,C>
      Parameters:
      c - the instance to convert; will never be null
      Returns:
      the converted instance; must not be null
    • correctedDoForward

      @CheckForNull C correctedDoForward(@CheckForNull A a)
      Overrides:
      correctedDoForward in class Converter<A,C>
    • correctedDoBackward

      @CheckForNull A correctedDoBackward(@CheckForNull C c)
      Overrides:
      correctedDoBackward in class Converter<A,C>
    • equals

      public boolean equals(@CheckForNull Object object)
      Description copied from class: Converter
      Indicates 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 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.

      Specified by:
      equals in interface Function<A,B>
      Overrides:
      equals in class Converter<A,C>
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object