package com.goafanti.common.bo;

import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonIgnore;

public class Error implements Serializable {

	private static final long serialVersionUID = 1723573714163714211L;

	private transient String code;

	private String field;

	private String message;

	public Error() {
		this("", "", "");
	}

	public Error(String message) {
		this("", "", message);
	}

	public Error(String code, String message) {
		this(code, "", message);
	}

	public Error(String code, String field, String message) {
		this.code = code;
		this.field = field;
		this.message = message;
	}

	/**
	 * @return the code
	 */
	@JsonIgnore
	public String getCode() {
		return code;
	}

	/**
	 * @param code
	 *            the code to set
	 */
	public void setCode(String code) {
		this.code = code;
	}

	/**
	 * @return the field
	 */
	public String getField() {
		return field;
	}

	/**
	 * @param field
	 *            the field to set
	 */
	public void setField(String field) {
		this.field = field;
	}

	/**
	 * @return the message
	 */
	public String getMessage() {
		return message;
	}

	/**
	 * @param message
	 *            the message to set
	 */
	public void setMessage(String message) {
		this.message = message;
	}

	public Error field(String field) {
		this.field = field;
		return this;
	}

	public Error message(String message) {
		this.message = message;
		return this;
	}

}
