// Path: commons-eid-consumer/src/main/java/be/bosa/commons/eid/consumer/Gender.java
// public enum Gender implements Serializable {
// 	MALE,
// 	FEMALE
// }


import be.bosa.commons.eid.consumer.Gender;
/*
 * Commons eID Project.
 * Copyright (C) 2014 - 2018 BOSA.
 *
 * This is free software; you can redistribute it and/or modify it under the
 * terms of the GNU Lesser General Public License version 3.0 as published by
 * the Free Software Foundation.
 *
 * This software is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
 * for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this software; if not, see https://www.gnu.org/licenses/.
 */

package be.bosa.commons.eid.consumer.tlv;


/**
 * Data convertor for gender data type.
 * 
 * @author Frank Cornelis
 * 
 */
public class GenderDataConvertor implements DataConvertor<Gender> {

	@Override
	public Gender convert(byte[] value) throws DataConvertorException {
		String genderStr = new String(value);
		if ("M".equals(genderStr)) {
			return Gender.MALE;
		}
		if ("F".equals(genderStr)) {
// Path: commons-eid-consumer/src/main/java/be/bosa/commons/eid/consumer/Gender.java
// public enum Gender implements Serializable {
// 	MALE,
// 	FEMALE
// }


// Path: commons-eid-consumer/src/main/java/be/bosa/commons/eid/consumer/tlv/GenderDataConvertor.java
import be.bosa.commons.eid.consumer.Gender;

/*
 * Commons eID Project.
 * Copyright (C) 2014 - 2018 BOSA.
 *
 * This is free software; you can redistribute it and/or modify it under the
 * terms of the GNU Lesser General Public License version 3.0 as published by
 * the Free Software Foundation.
 *
 * This software is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
 * for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this software; if not, see https://www.gnu.org/licenses/.
 */

package be.bosa.commons.eid.consumer.tlv;


/**
 * Data convertor for gender data type.
 * 
 * @author Frank Cornelis
 * 
 */
public class GenderDataConvertor implements DataConvertor<Gender> {

	@Override
	public Gender convert(byte[] value) throws DataConvertorException {
		String genderStr = new String(value);
		if ("M".equals(genderStr)) {
			return Gender.MALE;
		}
		if ("F".equals(genderStr)) {
			return Gender.FEMALE;