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

org.bitbucket.cowwoc.requirements.java.ValidationFailure Maven / Gradle / Ivy

/*
 * Copyright (c) 2019 Gili Tzabari
 * Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
 */
package org.bitbucket.cowwoc.requirements.java;

/**
 * A failed validation.
 */
public interface ValidationFailure
{
	/**
	 * Returns the message associated with the failure.
	 *
	 * @return the message associated with the failure
	 */
	String getMessage();

	/**
	 * Returns the type of exception associated with the failure.
	 *
	 * @return the type of exception associated with the failure
	 */
	Class getExceptionType();

	/**
	 * Creates an exception containing the failure message.
	 *
	 * @param   the type of the exception
	 * @param type the type of the exception
	 * @return the exception corresponding to the validation failure
	 * @throws NullPointerException if {@code type} is null
	 */
	 E createException(Class type);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy