package edu.neu.ccs.evergreen.exception; import edu.neu.ccs.evergreen.model.Constraint; import edu.neu.ccs.evergreen.model.State; /** * Exception used to signal a contradiction. */ @SuppressWarnings("serial") public class ContradictionException extends RuntimeException { private State state; private Constraint constraint; /** * Create a new exception. * * @param message * Reason for contradiction */ public ContradictionException(String message) { this(message, null, null); } /** * Create a new exception. * * @param message * Reason for contradiction * @param constraint * Constraint that caused the contradiction */ public ContradictionException(String message, Constraint constraint) { this(message, null, constraint); } /** * Create a new exception. * * @param message * Reason for contradiction * @param state * State at the time of the contradiction * @param constraint * Constraint that caused the contradiction */ public ContradictionException(String message, State state, Constraint constraint) { super(message); this.state = state; this.constraint = constraint; } /** * State active when contradiction occurred. * * @return State */ public State getState() { return state; } /** * Constraint involved in contradiction. * * @return Constraint */ public Constraint getConstraint() { return constraint; } }