package ei.engine.network.message;

import ei.engine.network.message.type.EchoMessage;
import ei.engine.network.message.type.ResponseRequestMessage;

public class StringMessage extends Message implements ResponseRequestMessage, EchoMessage{
	private static final long serialVersionUID = 1L;
	private boolean echo;
	private double responseId;
	
	private String msg;
	
	public StringMessage(String msg){
		this.msg = msg;
		echo = true;
		responseId = Math.random();
	}
	
	public String getString(){
		return msg;
	}
	
	public void setString(String msg){
		this.msg = msg;
	}
	
	public String toString(){
		return getString();
	}

	public boolean echo() {
		return echo;
	}

	public void recived() {
		echo = false;		
	}

	public double getResponseId() {
		return responseId;
	}
}
