package com.enactor.training.paymentService.service.messages.gcash;


import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.namespace.QName;

import com.enactor.core.application.process.ApplicationProcessDataType;
import com.enactor.core.application.process.IApplicationProcessDataType;
import com.enactor.core.entities.PropertyValidationException;
import com.enactor.core.utilities.Logger;	

/**
 * Add comments for the CurrencyAmount entity implementation here
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "CurrencyAmount", namespace=com.enactor.training.PackageInfo.NSURI_TRAINING, propOrder = {
	"currency",
	"value"
})

@XmlRootElement(name = CurrencyAmount.ENTITY_NAME, namespace=com.enactor.training.PackageInfo.NSURI_TRAINING)
public class CurrencyAmount implements ICurrencyAmount {

	/** My logger instance */
	@SuppressWarnings("unused")
	private static final Logger logger = Logger.getLogger(CurrencyAmount.class);
	
	/** serialVersionUID */
	private static final long serialVersionUID = 1L;
	
	/** Entity name. */
	public static final String ENTITY_NAME = "currencyAmount";
	
	/** Entity QName */
	public static final QName ENTITY_QNAME = new QName(com.enactor.training.PackageInfo.NSURI_TRAINING, ENTITY_NAME, com.enactor.training.PackageInfo.PREFIX_TRAINING);

	/** Entity application data type name */
	public static final String ENTITY_DATA_TYPE_NAME = "enactor.robinsons.messages.CurrencyAmount";
	
	/** Entity application data type */
	public static final IApplicationProcessDataType ENTITY_DATA_TYPE = new ApplicationProcessDataType(ENTITY_DATA_TYPE_NAME, ICurrencyAmount.class.getName());	
		
	/** The Currency field */
	private String currency = null;
	
	/** The Value field */
	private Long value = null;

	/**************************************************************************
	 * CurrencyAmount Interface
	 **************************************************************************/
	
	@Override
	public void setCurrency(String currency) throws PropertyValidationException {
		this.currency = currency;
	}
	
	@Override
	public String getCurrency() {
		return (currency == null) ? "" : currency;
	}
	
	@Override
	public void setValue(long value) throws PropertyValidationException {
		this.value = value;
	}
	
	@Override
	public long getValue() {
		return (value == null) ? 0 : value;
	}
	
	@Override
	public QName getEntityQName() {
		return ENTITY_QNAME;
	}

}
