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

## Class StringToBooleanConverter

- java.lang.Object
- - org.apache.torque.generator.source.transform.model.StringToBooleanConverter

- All Implemented Interfaces:
    `TypeConverter`

      public class StringToBooleanConverter
      extends Object
      implements TypeConverter

  Converts a String to a Boolean.
  Version:
    $Id: $

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `StringToBooleanConverter()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | 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.

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

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

- - ### Constructor Detail

    - #### StringToBooleanConverter

          public StringToBooleanConverter()

  - ### Method Detail

    - #### accept

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

      Description copied from interface: `TypeConverter`
      Returns true if and only if the converter can convert the passed value to the passed class.
      Specified by:
        `accept` in interface `TypeConverter`
      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

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

      Description copied from interface: `TypeConverter`
      Converts the passed value to the passed class. Is only called if accept has returned true.
      Specified by:
        `convert` in interface `TypeConverter`
      Parameters:
        `value` - the value to convert, may be null.
        `targetClass` - the target class, not null.
      Returns:
        the converted value.