Package org.apache.commons.beanutils2.converters

# Class ConverterFacade<T>

java.lang.Object
org.apache.commons.beanutils2.converters.ConverterFacade<T>

Type Parameters:
  `T` - The converter type.

All Implemented Interfaces:
  `Converter<T>`

public final class ConverterFacade<T> extends Object implements Converter<T>

Provides a facade for `Converter` implementations preventing access to any public API in the implementation, other than that specified by `Converter`.

This implementation can be used to prevent registered `Converter` implementations that provide configuration options from being retrieved and modified.

Since:
  1.8.0

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ConverterFacade(Converter<T> converter)`
  Constructs a converter which delegates to the specified `Converter` implementation.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `<R> R`
  `convert(Class<R> type, Object value)`
  Convert the input object into an output object of the specified type by delegating to the underlying `Converter` implementation.
  `String`
  `toString()`
  Provide a String representation of this facade implementation sand the underlying `Converter` it delegates to.

  ### Methods inherited from class java.lang.Object

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

- ## Constructor Details

  - ### ConverterFacade

    public ConverterFacade(Converter<T> converter)
    Constructs a converter which delegates to the specified `Converter` implementation.
    Parameters:
      `converter` - The converter to delegate to

- ## Method Details

  - ### convert

    public <R> R convert(Class<R> type, Object value)
    Convert the input object into an output object of the specified type by delegating to the underlying `Converter` implementation.
    Specified by:
      `convert` in interface `Converter<T>`
    Type Parameters:
      `R` - the result type.
    Parameters:
      `type` - Data type to which this value should be converted
      `value` - The input value to be converted
    Returns:
      The converted value.

  - ### toString

    public String toString()
    Provide a String representation of this facade implementation sand the underlying `Converter` it delegates to.
    Overrides:
      `toString` in class `Object`
    Returns:
      A String representation of this facade implementation sand the underlying `Converter` it delegates to