org.apache.torque.generator.source.transform.model

## Interface TypeConverter

- All Known Implementing Classes:
    StringToBooleanConverter

      public interface TypeConverter

  Converts a type to another type.
  Version:
    $Id: $

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `accept(Object value, Class<?> targetClass)` Returns true if and only if the converter can convert the passed value to the passed class.
    `Object` | `convert(Object value, Class<?> targetClass)` Converts the passed value to the passed class.

- - ### Method Detail

    - #### accept

          boolean accept(Object value,
                         Class<?> targetClass)

      Returns true if and only if the converter can convert the passed value to the passed class.
      Parameters:
        `value` - the value to convert, may be null.
        `targetClass` - the target class, not null.
      Returns:
        whether the converter can convert the value to the passed target class.

    - #### convert

          Object convert(Object value,
                         Class<?> targetClass)

      Converts the passed value to the passed class. Is only called if accept has returned true.
      Parameters:
        `value` - the value to convert, may be null.
        `targetClass` - the target class, not null.
      Returns:
        the converted value.

Copyright © 2000–2020 The Apache Software Foundation. All rights reserved.