org.springframework.core.convert.support
Class StringToBooleanConverter

java.lang.Object
  extended by org.springframework.core.convert.support.StringToBooleanConverter
All Implemented Interfaces:
Converter<java.lang.String,java.lang.Boolean>

final class StringToBooleanConverter
extends java.lang.Object
implements Converter<java.lang.String,java.lang.Boolean>

Converts String to a Boolean.

Since:
3.0
Author:
Keith Donald, Juergen Hoeller

Field Summary
private static java.util.Set<java.lang.String> falseValues
           
private static java.util.Set<java.lang.String> trueValues
           
 
Constructor Summary
StringToBooleanConverter()
           
 
Method Summary
 java.lang.Boolean convert(java.lang.String source)
          Convert the source of type S to target type T.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

trueValues

private static final java.util.Set<java.lang.String> trueValues

falseValues

private static final java.util.Set<java.lang.String> falseValues
Constructor Detail

StringToBooleanConverter

StringToBooleanConverter()
Method Detail

convert

public java.lang.Boolean convert(java.lang.String source)
Description copied from interface: Converter
Convert the source of type S to target type T.

Specified by:
convert in interface Converter<java.lang.String,java.lang.Boolean>
Parameters:
source - the source object to convert, which must be an instance of S
Returns:
the converted object, which must be an instance of T