//
// https://www.ramecera.it/myscrewdriver.html
// e-mail: screwdriver@ramecera.it
//
/* This program and the accompanying materials are made available under
 * the terms of the Eclipse Public License v1.0 which accompanies this
 * distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html */
package it.ramecera.salad.everyday;

/**
 * <p>
 * Class to handle an exception with a code specification.
 * </p>
 * <p>
 * Company: Ramecera™<br>
 * Creation date: 2020-04-09<br>
 * Last updated: 2020-06-13<br>
 * Modifications: none<br>
 * </p>
 * 
 * @author M. Maglioni */

public class ExactException

		extends Exception {

	/** pure formality */
	static final long serialVersionUID = 0;

	/** string information, for use as desired */
	public String datum;

	/** numerical information, for use as desired */
	public int code;

	/** full information, for use as desired */
	public int n;

	/** in which class the exception occurred */
	public String className;

	/** in which method the exception occurred */
	public String method;

	/** in which element the exception occurred */
	public int line;

	/**
	 * <p>
	 * Default constructor.
	 * </p>
	 * <p>
	 * Creation date: 2020-04-09<br>
	 * Last updated: 2020-06-13<br>
	 * Modifications: none<br>
	 * </p>
	 */
	public ExactException() {

	}

	/**
	 * <p>
	 * Next constructor.
	 * </p>
	 * <p>
	 * Creation date: 2020-04-09<br>
	 * Last updated: 2020-04-09<br>
	 * Modifications: none<br>
	 * </p>
	 * 
	 * @param s message associated with the exception, sent to the
	 *        superclass */
	public ExactException(final String s) {
		super(s);
	}

	/**
	 * <p>
	 * Next constructor.
	 * </p>
	 * <p>
	 * Creation date: 2020-04-09<br>
	 * Last updated: 2020-06-13<br>
	 * Modifications: none<br>
	 * </p>
	 * 
	 * @param datum message associated with the exception
	 * @param code error code
	 * @param className obvious
	 * @param methodName obvious */
	public ExactException(final String datum, final int code,
			final String className, final String methodName) {
		super(datum);
		this.datum = datum;
		this.code = code;
		this.className = className;
		this.method = methodName;
	}

	/**
	 * <p>
	 * Next constructor.
	 * </p>
	 * <p>
	 * Creation date: 2020-04-09<br>
	 * Last updated: 2020-06-13<br>
	 * Modifications: none<br>
	 * </p>
	 * 
	 * @param datum message associated with the exception
	 * @param code error code
	 * @param className obvious
	 * @param methodName obvious
	 * @param line which element produced an error */
	public ExactException(final String datum, final int code,
			final String className, final String methodName,
			final int line) {
		super(datum);
		this.datum = datum;
		this.code = code;
		this.className = className;
		this.method = methodName;
		this.line = line;
	}

	/**
	 * <p>
	 * Creation date: 2020-04-20<br>
	 * Last updated: 2020-04-20<br>
	 * Class: ExactException
	 * 
	 * @author M. Maglioni
	 *         <p>
	 *         Description:
	 *         </p>
	 * @return the datum */
	public String getData() {
		return datum;
	}

	/**
	 * <p>
	 * Creation date: 2020-04-20<br>
	 * Last updated: 2020-06-13<br>
	 * Class: ExactException
	 * 
	 * @author M. Maglioni
	 *         <p>
	 *         Description:
	 *         </p>
	 * @param datum obvious */
	public void setDatum(String datum) {
		this.datum = datum;
	}
}