javax0.jamal.tools.ThrowingAPI Maven / Gradle / Ivy
package javax0.jamal.tools;
import javax0.jamal.api.BadSyntax;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Predicate;
public interface ThrowingAPI {
interface HasMessage {
NoMessage when(boolean condition) throws BadSyntax;
NoMessage when(Predicate condition) throws BadSyntax;
NoMessage when(boolean condition, Throwing.Consumer consumer) throws BadSyntax;
NoMessage when(Predicate condition, Throwing.Consumer consumer) throws BadSyntax;
NoMessage when(Class condition, Throwing.Consumer consumer) throws BadSyntax;
NoMessage map(Throwing.Function function) throws BadSyntax;
NoMessage cast(Class klass) throws BadSyntax;
T get();
}
interface NoMessage {
NoMessage when(boolean condition, Consumer consumer) throws BadSyntax;
NoMessage when(Predicate condition, Consumer consumer) throws BadSyntax;
NoMessage when(Class condition, Consumer consumer) throws BadSyntax;
HasMessage hurl(java.util.function.Supplier message);
HasMessage hurl(String format, Object... parameters);
NoMessage map(Function function) throws BadSyntax;
NoMessage map(Throwing.Function function, java.util.function.Supplier message) throws BadSyntax;
NoMessage map(Throwing.Function function, String hurlMessage, Object... parameters) throws BadSyntax;
T get();
}
}