org.kuali.rice.krad.data.jpa.converters
Class InverseBooleanYNConverter

java.lang.Object
  extended by org.kuali.rice.krad.data.jpa.converters.InverseBooleanYNConverter
All Implemented Interfaces:
javax.persistence.AttributeConverter<Boolean,String>

public class InverseBooleanYNConverter
extends Object
implements javax.persistence.AttributeConverter<Boolean,String>

Converts true/false represented by a set of yes characters and the character "N" to and from false and true.

The conversion treats the values as follows: "Y", "y", "true", and "TRUE" are all false and "N" is true.

Author:
Kuali Rice Team (rice.collab@kuali.org)

Field Summary
protected static Set<String> YES_VALUES
          Defines the set of values that all correspond to yes.
 
Constructor Summary
InverseBooleanYNConverter()
           
 
Method Summary
 String convertToDatabaseColumn(Boolean objectValue)
           This implementation will convert from a false or true value to an "Y" or "N" value.
 Boolean convertToEntityAttribute(String dataValue)
           This implementation will convert from a "F" or any of the yes values to a true or false.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

YES_VALUES

protected static final Set<String> YES_VALUES
Defines the set of values that all correspond to yes.

Constructor Detail

InverseBooleanYNConverter

public InverseBooleanYNConverter()
Method Detail

convertToDatabaseColumn

public String convertToDatabaseColumn(Boolean objectValue)
This implementation will convert from a false or true value to an "Y" or "N" value.

Specified by:
convertToDatabaseColumn in interface javax.persistence.AttributeConverter<Boolean,String>

convertToEntityAttribute

public Boolean convertToEntityAttribute(String dataValue)
This implementation will convert from a "F" or any of the yes values to a true or false.

Specified by:
convertToEntityAttribute in interface javax.persistence.AttributeConverter<Boolean,String>


Copyright © 2005–2015 The Kuali Foundation. All rights reserved.