/**
 * 
 */
package com.ejie.m62fb.utils.error;

import java.util.List;

import com.ejie.x38.control.exception.ControlException;

/**
XXXX
 * 
 */
public class UFException extends ControlException {

	/** The Serial Version UID. */
	private static final long serialVersionUID = -5320695887467067401L;

	private String userFriendlyMessage = "";
	private List<Object> userFriendlyMessageParams = null;

	/**
	 * Constructs a new user friendly exception with the specified detail
	 * message. The cause is not initialized, and may subsequently be
	 * initialized by a call to {@link #initCause}.
	 * 
	 * @param message
	 *            the detail message. The detail message is saved for later
	 *            retrieval by the {@link #getMessage()} method.
	 */
	public UFException(final String message) {
		super(message);
	}

	/**
	 * Constructs a new user friendly exception with the specified detail
	 * message and params. The cause is not initialized, and may subsequently be
	 * initialized by a call to {@link #initCause}.
	 * 
	 * @param message
	 *            the detail message. The detail message is saved for later
	 *            retrieval by the {@link #getMessage()} method.
	 * @param cause
	 *            the cause (which is saved for later retrieval by the
	 *            {@link #getCause()} method). (A <tt>null</tt> value is
	 *            permitted, and indicates that the cause is nonexistent or
	 *            unknown.)
	 */
	public UFException(final String message,
			final List<Object> userFriendlyMessageParams) {
		super(message);
		this.userFriendlyMessageParams = userFriendlyMessageParams;
	}

	/**
	 * Constructs a new user friendly exception with the specified detail
	 * message and cause.
	 * <p>
	 * Note that the detail message associated with <code>cause</code> is
	 * <i>not</i> automatically incorporated in this runtime exception's detail
	 * message.
	 * </p>
	 * 
	 * @param message
	 *            the detail message (which is saved for later retrieval by the
	 *            {@link #getMessage()} method).
	 * @param cause
	 *            the cause (which is saved for later retrieval by the
	 *            {@link #getCause()} method). (A <tt>null</tt> value is
	 *            permitted, and indicates that the cause is nonexistent or
	 *            unknown.)
	 */
	public UFException(final String message, final Throwable cause) {
		super(message, cause);
	}

	/**
	 * Devuelve el mensaje internacionalizable a mostrar al usuario.
	 * 
	 * @return Mensaje internacionalizable a mostrar
	 */
	public String getUFMessage() {
		return this.userFriendlyMessage;
	}

	/**
	 * Estable el mensaje inernacionalizable a mostrar al usuario.
	 * 
	 * @param userFriendlyMessage
	 *            Mensaje internacionalizable a mostrar
	 */
	public void setUFMessage(final String userFriendlyMessage) {
		this.userFriendlyMessage = userFriendlyMessage;
	}

	/**
	 * Devuelve la lista de parametros a utilizar en el formateo del mensaje.
	 * 
	 * @return Lista de parametros a utilizar en el formateo del mensaje
	 */
	public List<Object> getUFParams() {
		return this.userFriendlyMessageParams;
	}

	/**
	 * Establece la lista de parametros a utilizar en el formateo del mensaje.
	 * 
	 * @param userFriendlyMessageParams
	 *            Lista de parametros a utilizar en el formateo del mensaje.
	 */
	public void setUFParams(final List<Object> userFriendlyMessageParams) {
		this.userFriendlyMessageParams = userFriendlyMessageParams;
	}
}
