refactor(method): move Method related classes to method package
This commit is contained in:
parent
1891037ed7
commit
8842e9d8e1
@ -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);
|
||||||
|
@ -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;
|
||||||
|
|
||||||
|
|
||||||
|
@ -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> {
|
||||||
|
|
||||||
|
@ -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> {
|
||||||
|
|
||||||
|
@ -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> {
|
||||||
|
@ -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;
|
@ -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;
|
@ -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
|
||||||
|
@ -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) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user