
org.cthul.proc.P3 Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cthul-matchers Show documentation
Show all versions of cthul-matchers Show documentation
Provides hamcrest.org matchers for strings and exceptions,
allows matching code blocks, and provides several utilities for
combining matchers.
The newest version!
package org.cthul.proc;
/**
* A {@link ProcBase ProcBase} with three parameters.
*/
public class P3 extends ProcBase> implements Proc3 {
protected P3(ProcBase source, Object[] args) {
super(source, args);
}
public P3(ProcBase source, A a, B b, C c) {
super(source, a, b, c);
}
public P3(ProcBase source) {
super(source);
}
public P3(A a, B b, C c) {
super(a, b, c);
}
public P3() {
}
/**
* {@inheritDoc}
*/
@Override
protected P3 createCopy(Object[] args) {
return new P3<>(this, args);
}
/**
* {@inheritDoc}
*/
@Override
@SuppressWarnings("unchecked")
protected Object run(Object[] args) throws Throwable {
assertArgCount(args, 3);
return run((A)args[0], (B)args[1], (C)args[2]);
}
/**
* Executes the proc.
* @param a
* @param b
* @return result
* @throws Throwable
*/
protected Object run(A a, B b, C c) throws Throwable {
throw notImplemented("run(A, B, C)");
}
@Override
public P3 call(A a, B b, C c) {
return copy(a, b, c);
}
@Override
public P3 with(A a, B b, C c) {
return call(a, b, c);
}
@Override
public Proc2 curry(A a) {
return curry((Object) a).asProc2();
}
@Override
public Proc1 curry(A a, B b) {
return curry((Object) a, (Object) b).asProc1();
}
@Override
public Proc0 curry(A a, B b, C c) {
return curry((Object) a, (Object) b, (Object) c).asProc0();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy