Class ToStringConverter

  • All Implemented Interfaces:
    Converter

    public final class ToStringConverter
    extends java.lang.Object
    implements Converter
    A Converter from any class to a String via the toString method.

    This should only be used as a fall-back converter, as a last attempt.

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <T> T convert​(java.lang.Object source, java.lang.Class<T> toClass)
      Attempt to convert a given object to a named class.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ToStringConverter

        public ToStringConverter()
    • Method Detail

      • convert

        public <T> T convert​(java.lang.Object source,
                             java.lang.Class<T> toClass)
        Description copied from interface: Converter
        Attempt to convert a given object to a named class.
        Specified by:
        convert in interface Converter
        Type Parameters:
        T - The class to convert to.
        Parameters:
        source - The object to convert.
        toClass - The class to convert to.
        Returns:
        The converted class or null if the conversion was not possible.