org.apache.tapestry.coerce
Class NumberToBooleanConverter

java.lang.Object
  extended by org.apache.tapestry.coerce.NumberToBooleanConverter
All Implemented Interfaces:
TypeConverter

public final class NumberToBooleanConverter
extends java.lang.Object
implements TypeConverter

Converts an arbitrary number to a boolean; uses the long value of the number and evaluates to true unless the value is zero.

Since:
4.0
Author:
Howard M. Lewis Ship

Constructor Summary
NumberToBooleanConverter()
           
 
Method Summary
 java.lang.Object convertValue(java.lang.Object value)
          Converts the value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NumberToBooleanConverter

public NumberToBooleanConverter()
Method Detail

convertValue

public java.lang.Object convertValue(java.lang.Object value)
Description copied from interface: TypeConverter
Converts the value.

Specified by:
convertValue in interface TypeConverter
Parameters:
value - the value to be converted (which may be null)
Returns:
the value converted to a specific type; different implementations of TypeConverter will return different types.