net.sf.andromedaioc.bean.converter.fromboolean.FromBooleanToByteConverter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of andromeda-ioc Show documentation
Show all versions of andromeda-ioc Show documentation
Inversion of Control Framework for Android
The newest version!
package net.sf.andromedaioc.bean.converter.fromboolean;
import net.sf.andromedaioc.bean.converter.Converter;
/**
* From Boolean to Byte converter
*
* @author Alexey Mitrov
*/
public class FromBooleanToByteConverter implements Converter {
public Byte convert(Boolean input) {
return input == null ? null : (input ? Byte.valueOf((byte) 1) : Byte.valueOf((byte) 0));
}
}