// Path: src/main/java/com/sulaco/fuse/akka/message/FuseRequestMessage.java
// public interface FuseRequestMessage extends Route {
// 
//     long getId();
// 
//     HttpRequest getRequest();
// 
//     String getRequestBody();
// 
//     ChannelHandlerContext getChannelContext();
// 
//     void flush();
// 
//     boolean flushed();
// 
//     public <T> Optional<T> getParam(String name, Class<T> clazz);
// 
// }


import java.lang.reflect.Method;
import java.util.Optional;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.atomic.AtomicLong;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.sulaco.fuse.akka.message.FuseRequestMessage;

package com.sulaco.fuse.util;




public class Tools {

    private static ConcurrentMap<String, ConcurrentMap<String, String>> keyCache
        = new ConcurrentHashMap<>();
    
    private static ConcurrentMap<String, Optional<Method>> methodCache 
        = new ConcurrentHashMap<>();
    
    public static <T> Optional<T> empty() {
        return Optional.empty();
    }
    
    public static final <T> Optional<T> optional(T value) {
        return Optional.ofNullable(value);
    }
    
    public static final Optional<Method> lookupMethod(final Object target, final String methodName) {
        
        Class<?> clazz = target.getClass();
        
        String key = getMethodKey(clazz.getName(), methodName);
        
        methodCache
            .computeIfAbsent(
                key, 
                k -> {
                    Method method = null;
                    
                    try {

// Path: src/main/java/com/sulaco/fuse/akka/message/FuseRequestMessage.java
// public interface FuseRequestMessage extends Route {
// 
//     long getId();
// 
//     HttpRequest getRequest();
// 
//     String getRequestBody();
// 
//     ChannelHandlerContext getChannelContext();
// 
//     void flush();
// 
//     boolean flushed();
// 
//     public <T> Optional<T> getParam(String name, Class<T> clazz);
// 
// }


// Path: src/main/java/com/sulaco/fuse/util/Tools.java
import java.lang.reflect.Method;
import java.util.Optional;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.atomic.AtomicLong;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.sulaco.fuse.akka.message.FuseRequestMessage;

package com.sulaco.fuse.util;




public class Tools {

    private static ConcurrentMap<String, ConcurrentMap<String, String>> keyCache
        = new ConcurrentHashMap<>();
    
    private static ConcurrentMap<String, Optional<Method>> methodCache 
        = new ConcurrentHashMap<>();
    
    public static <T> Optional<T> empty() {
        return Optional.empty();
    }
    
    public static final <T> Optional<T> optional(T value) {
        return Optional.ofNullable(value);
    }
    
    public static final Optional<Method> lookupMethod(final Object target, final String methodName) {
        
        Class<?> clazz = target.getClass();
        
        String key = getMethodKey(clazz.getName(), methodName);
        
        methodCache
            .computeIfAbsent(
                key, 
                k -> {
                    Method method = null;
                    
                    try {

                        method = clazz.getMethod(methodName, FuseRequestMessage.class);
