All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.polaris.core.err.AssertionException Maven / Gradle / Ivy

There is a newer version: 3.2.1
Show newest version
package io.polaris.core.err;

import io.polaris.core.tuple.ValueRef;

/**
 * @author Qt
 * @since 1.8
 */
public class AssertionException extends IllegalArgumentException {
	private static final long serialVersionUID = 1L;
	private ValueRef expected;
	private ValueRef actual;

	public AssertionException(String s, Object expected, Object actual) {
		super(s);
		init(expected, actual);
	}

	public AssertionException(String message, Throwable cause, Object expected, Object actual) {
		super(message, cause);
		init(expected, actual);
	}


	private void init(Object expected, Object actual) {
		this.expected = ValueRef.of(expected);
		this.actual = ValueRef.of(actual);
	}

	public AssertionException(String s) {
		super(s);
	}

	public AssertionException(String message, Throwable cause) {
		super(message, cause);
	}

	public ValueRef getExpected() {
		return expected;
	}

	public ValueRef getActual() {
		return actual;
	}
}