- All Implemented Interfaces:
- org.springframework.expression.TypeConverter
public class RelaxedBooleanTypeConverterDecorator
extends Object
implements org.springframework.expression.TypeConverter
Decorator for TypeConverter that can convert numbers,
collections and arrays to boolean value. Not matching types delegates to
the decorated converter.
Number -> Boolean:
value = 0 ? false : true
Collection -> Boolean:
value.isEmpty()? ? false : true
Array -> Boolean:
value.length == 0 ? false : true
Else
delegate to decorated
- Author:
- Jakub Jirutka