package communication.messages;

import common.ErrorType;

/**
 * A message representing that a certain error type has occurred with specific
 * parameters
 */
public class ElevatorErrorOccuredMessage implements Message {
	private static final long serialVersionUID = -3365564244200632248L;
	private ErrorType errorType;
	private int errorFloor;
	private int elevatorId;

	/**
	 * Construct a new error occurred message
	 * @param errorType
	 * @param errorFloor which floor the incident occurred on
	 * @param elevatorId
	 */
	public ElevatorErrorOccuredMessage(ErrorType errorType, int errorFloor, int elevatorId) {
		this.errorType = errorType;
		this.errorFloor = errorFloor;
		this.elevatorId = elevatorId;
	}

	public ErrorType getErrorType() {
		return errorType;
	}

	public int getErrorFloor() {
		return errorFloor;
	}

	public int getElevatorId() {
		return elevatorId;
	}

	@Override
	public String toString() {
		return "ElevatorErrorOccuredMessage [errorType=" + errorType + ", errorFloor=" + errorFloor + ", elevatorId="
				+ elevatorId + "]";
	}
}
