package generated.javacard.mondex.purse;

/**
 * Generated Class
 * 
 */
public class Msgcontent implements PlainData, Codeable {

	public short msgflag;
	public PayDetails pd;

	/**
	 * Constructor wich sets all attributes to a initial value
	 */
	public Msgcontent() {
		msgflag = 0;
		pd = new PayDetails();
	}

	/**
	 * Method for getting the typeflag
	 *
	 * @return den class-specific code
	 */
	public byte getCode() {
		return Code.MSGCONTENT;
	}

	/**
	 * This method deeply checks equality of classes.
	 *
	 * @param other Class to compare with
	 * @return true, if values of all attributes are equal
	 */
	public boolean equals(Codeable other) {
		//The types of the objects have to match
		if (getCode() != other.getCode())
			return false;
		//Attributes of complex type: Use their equals-method
		if (!this.pd.equals(((Msgcontent) other).pd))
			return false;
		//msgflag is of primitive type: We can use ==
		if (this.msgflag != ((Msgcontent) other).msgflag)
			return false;
		return true;
	}

	public void copy(Msgcontent from) {
		//Complex types: Use their copy-method.
		this.pd.copy(from.pd);
		//msgflag is of primitive type: simple assignment
		this.msgflag = from.msgflag;
	}

}