feat(core): add Context generic
This commit is contained in:
@@ -11,14 +11,14 @@ class ReflectedMethodTest {
|
||||
|
||||
@Test
|
||||
void methodTest() {
|
||||
ReflectedMethod<String> method = new TestReflectedMethod(new TestMethodClass());
|
||||
ReflectedMethod<String, String> method = new TestReflectedMethod(new TestMethodClass());
|
||||
Object result = method.run("testContext");
|
||||
assertTrue((boolean)result);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testBCMethod() {
|
||||
ReflectedMethod<?> method = new BestCandidateMethod<String>(
|
||||
ReflectedMethod<String, Double> method = new BestCandidateMethod<String, Double>(
|
||||
"test",
|
||||
new TestMethodClass(),
|
||||
"ident",
|
||||
|
||||
@@ -4,7 +4,7 @@ import java.lang.reflect.Method;
|
||||
|
||||
import net.tomatentum.cutin.method.ReflectedMethod;
|
||||
|
||||
public class TestReflectedMethod extends ReflectedMethod<String> {
|
||||
public class TestReflectedMethod extends ReflectedMethod<String, String> {
|
||||
|
||||
protected TestReflectedMethod(Object containingObject) {
|
||||
super(getMethod(containingObject), containingObject);
|
||||
@@ -12,7 +12,7 @@ public class TestReflectedMethod extends ReflectedMethod<String> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getParameter(Object context, int index) {
|
||||
public Object getParameter(String context, int index) {
|
||||
return 2;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user