ToAnyConverter (cayenne-doc: Cayenne Documentation 5.0-M2 API)
Description: declaration: package: org.apache.cayenne.reflect, class: ToAnyConverter

# Class ToAnyConverter<T>

java.lang.Object
org.apache.cayenne.reflect.ToAnyConverter<T>

All Implemented Interfaces:
  `Converter<T>`

public class ToAnyConverter<T> extends Object implements Converter<T>
Can convert to any class that has a constructor that takes a single Object or a single String parameter.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ToAnyConverter()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `T`
  `convert(Object value, Class<T> type)`
  Converts object to supported class without doing any type checking.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### ToAnyConverter

    public ToAnyConverter()

- ## Method Details

  - ### convert

    public T convert(Object value, Class<T> type)
    Description copied from interface: `Converter`
    Converts object to supported class without doing any type checking.
    Specified by:
      `convert` in interface `Converter<T>`
    Parameters:
      `value` - the object to convert; the source
      `type` - the Class to convert the value to; the destination type
    Returns:
      an object of type @code{type}. If the conversion fails an exception will be thrown. If value is null then the result will be null.