refactor(method): move Method related classes to method package

This commit is contained in:
tueem 2025-04-11 12:16:58 +02:00
parent 1891037ed7
commit 8842e9d8e1
Signed by: tueem
GPG Key ID: 65C8667EC17A88FB
9 changed files with 14 additions and 6 deletions

View File

@ -4,6 +4,8 @@ import java.lang.reflect.Method;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
import net.tomatentum.cutin.method.ReflectedMethod;
public interface ReflectedMethodFactory<I extends Object> { public interface ReflectedMethodFactory<I extends Object> {
Optional<ReflectedMethod<I>> produce(Method method, Object containingClass); Optional<ReflectedMethod<I>> produce(Method method, Object containingClass);

View File

@ -8,6 +8,7 @@ import java.util.Optional;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import net.tomatentum.cutin.method.ReflectedMethod;
import net.tomatentum.cutin.util.ReflectionUtil; import net.tomatentum.cutin.util.ReflectionUtil;

View File

@ -8,8 +8,8 @@ import java.util.Map;
import java.util.Optional; import java.util.Optional;
import java.util.Set; import java.util.Set;
import net.tomatentum.cutin.ReflectedMethod;
import net.tomatentum.cutin.ReflectedMethodFactory; import net.tomatentum.cutin.ReflectedMethodFactory;
import net.tomatentum.cutin.method.ReflectedMethod;
public class LoneMethodContainer<I extends Object> implements MethodContainer<I> { public class LoneMethodContainer<I extends Object> implements MethodContainer<I> {

View File

@ -5,7 +5,7 @@ import java.util.Collection;
import java.util.Optional; import java.util.Optional;
import java.util.Set; import java.util.Set;
import net.tomatentum.cutin.ReflectedMethod; import net.tomatentum.cutin.method.ReflectedMethod;
public interface MethodContainer<I extends Object> { public interface MethodContainer<I extends Object> {

View File

@ -10,8 +10,8 @@ import java.util.stream.Collectors;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import net.tomatentum.cutin.ReflectedMethod;
import net.tomatentum.cutin.ReflectedMethodFactory; import net.tomatentum.cutin.ReflectedMethodFactory;
import net.tomatentum.cutin.method.ReflectedMethod;
import net.tomatentum.cutin.util.ReflectionUtil; import net.tomatentum.cutin.util.ReflectionUtil;
public class MultiMethodContainer<I extends Object> implements MethodContainer<I> { public class MultiMethodContainer<I extends Object> implements MethodContainer<I> {

View File

@ -1,4 +1,4 @@
package net.tomatentum.cutin; package net.tomatentum.cutin.method;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.util.Arrays; import java.util.Arrays;
@ -13,7 +13,7 @@ public class BestCandidateMethod<I> extends ReflectedMethod<I> {
private I identifier; private I identifier;
private List<Object> additionalParameters; private List<Object> additionalParameters;
protected BestCandidateMethod(String methodName, Object containingObject, I identifer, Object... additionalParameters) { public BestCandidateMethod(String methodName, Object containingObject, I identifer, Object... additionalParameters) {
super(getMethod(containingObject, methodName), containingObject); super(getMethod(containingObject, methodName), containingObject);
this.methodName = methodName; this.methodName = methodName;
this.identifier = identifer; this.identifier = identifer;

View File

@ -1,4 +1,4 @@
package net.tomatentum.cutin; package net.tomatentum.cutin.method;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method; import java.lang.reflect.Method;

View File

@ -4,6 +4,9 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import net.tomatentum.cutin.method.BestCandidateMethod;
import net.tomatentum.cutin.method.ReflectedMethod;
class ReflectedMethodTest { class ReflectedMethodTest {
@Test @Test

View File

@ -2,6 +2,8 @@ package net.tomatentum.cutin;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import net.tomatentum.cutin.method.ReflectedMethod;
public class TestReflectedMethod extends ReflectedMethod<String> { public class TestReflectedMethod extends ReflectedMethod<String> {
protected TestReflectedMethod(Object containingObject) { protected TestReflectedMethod(Object containingObject) {