org.databene.commons.converter
Class ToHashCodeConverter

java.lang.Object
  extended by org.databene.commons.converter.AbstractConverter<S,T>
      extended by org.databene.commons.converter.ThreadSafeConverter<java.lang.Object,java.lang.Integer>
          extended by org.databene.commons.converter.ToHashCodeConverter
All Implemented Interfaces:
java.lang.Cloneable, Converter<java.lang.Object,java.lang.Integer>, ThreadAware

public class ToHashCodeConverter
extends ThreadSafeConverter<java.lang.Object,java.lang.Integer>

Converts an arbitrary object to a hash code using the method hashCode(). Null values are converted to zero.

Created at 06.11.2008 07:37:17

Since:
0.4.6
Author:
Volker Bergmann

Field Summary
 
Fields inherited from class org.databene.commons.converter.AbstractConverter
sourceType, targetType
 
Constructor Summary
ToHashCodeConverter()
           
 
Method Summary
 java.lang.Integer convert(java.lang.Object sourceValue)
          Concerts an object of type S to an object of type T
 
Methods inherited from class org.databene.commons.converter.ThreadSafeConverter
clone, isParallelizable, isThreadSafe
 
Methods inherited from class org.databene.commons.converter.AbstractConverter
getSourceType, getTargetType
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ToHashCodeConverter

public ToHashCodeConverter()
Method Detail

convert

public java.lang.Integer convert(java.lang.Object sourceValue)
                          throws ConversionException
Description copied from interface: Converter
Concerts an object of type S to an object of type T

Parameters:
sourceValue - the object to convert
Returns:
the converted object
Throws:
ConversionException - if the conversion fails


Copyright © 2010. All Rights Reserved.