package utils;


public class GenericMessage {
	
	private String entity;
	private int statut;
	private String message;
	
	
	public GenericMessage() {
		message=" ";
	}
	
	public GenericMessage(String entity, int statut, String message) {
		this.entity = entity;
		this.statut = statut;
		this.message = message;
    }
	
	public String getEntity() {
		return this.entity;
	}
	
	public void setEntity(String entity) {
		this.entity = entity;
	}
	
	public int getStatut() {
		return this.statut;
	}
	
	public void setStatut(int statut) {
		this.statut = statut;
	}
	
	public String getMessage() {
		return this.message;
	}
	
	public void setMessage(String message){
		this.message=message;
	}
	
	public String toString() {
		StringBuffer sb = new StringBuffer();
		
		sb.append("\n");
		
		sb.append("entity:");
		sb.append(this.entity);
		sb.append("\n");
		
		sb.append("statut:");
     	sb.append(this.statut);
     	sb.append("\n");
		
     	if(this.statut==1){
     		sb.append("message");
     		sb.append("Validation Error!\n");
     	}else{
     		sb.append("message");
     		sb.append(this.message);
     		sb.append("\n");
     	}
     	return sb.toString();
    }

}
