Top Description Fields Constructors Methods
org.springframework.core.convert.support

pack-priv final Class StringToBooleanConverter

extends Object
implements Converter<String, Boolean>
Class Inheritance
All Implemented Interfaces
org.springframework.core.convert.converter.Converter
Imports
java.util.Set, org.springframework.core.convert.converter.Converter, org.springframework.lang.Nullable

Converts a String to a Boolean.
Authors
Keith Donald, Juergen Hoeller, Sam Brannen
Since
3.0

Field Summary

Modifier and TypeField and Description
private static final Set<String>
private static final Set<String>

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public Boolean
convert(String
the source object to convert, which must be an instance of S (never null)
source
)

Implements org.springframework.core.convert.converter.Converter.convert.

Convert the source object of type S to target type T.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

falseValuesback to summary
private static final Set<String> falseValues
trueValuesback to summary
private static final Set<String> trueValues

Constructor Detail

StringToBooleanConverterback to summary
pack-priv StringToBooleanConverter()

Method Detail

convertback to summary
public Boolean convert(String source)

Implements org.springframework.core.convert.converter.Converter.convert.

Doc from org.springframework.core.convert.converter.Converter.convert.

Convert the source object of type S to target type T.

Parameters
source:String

the source object to convert, which must be an instance of S (never null)

Returns:Boolean

the converted object, which must be an instance of T (potentially null)

Annotations
@Override
@Nullable