/**
 * 
 */
package Model;

/**
 * @author Christophe HAVARD
 *
 */
public class Log implements ILog {

	private boolean isSignatureValid;
	private boolean isUserValid;
	private final int logId;

	/**
	 * Represent an Log entry from the DB.
	 * @param The log id
	 * @param true if signature is valid.
	 * @param true if user is valid.
	 */
	public Log(final int logId, final boolean isSignatureValid, final boolean isUserValid) {
		this.logId = logId;
		this.isSignatureValid = isSignatureValid;
		this.isUserValid = isUserValid;
	}

	@Override
	public boolean isSignatureValid() {
		return this.isSignatureValid;
	}

	@Override
	public boolean isUserValid() {
		return this.isUserValid;
	}

	@Override
	public boolean isFalseApprobation() {
		if(this.isSignatureValid && !this.isUserValid){
			return true;
		} else {
			return false;
		}
	}

	@Override
	public boolean isFalseRefusal() {
		if(!this.isSignatureValid && this.isUserValid){
			return true;
		} else {
			return false;
		}
	}

	@Override
	public int getLogId() {
		return logId;
	}

}