package generated.javacard.mondex.purse;

/**
 * Generated Class
 * 
 */
public class StartFrom extends Message implements Codeable {

	public short value;
	public PurseData dataTo;

	/**
	 * Constructor wich sets all attributes to a initial value
	 */
	public StartFrom() {
		value = 0;
		dataTo = new PurseData();
	}

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

	/**
	 * 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;
		//value is of primitive type: We can use ==
		if (this.value != ((StartFrom) other).value)
			return false;
		//Attributes of complex type: Use their equals-method
		if (!this.dataTo.equals(((StartFrom) other).dataTo))
			return false;
		return true;
	}

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

}