// Path: src/main/java/com/sulaco/fuse/util/PrimitiveConverters.java
// @SuppressWarnings({"unchecked"})
// public class PrimitiveConverters {
// 
//     static Map<Class<?>, Function<String, ?>> converters = new HashMap<>();
//     static {
//         converters.put(Integer.class , Integer::valueOf);
//         converters.put(Long.class    , Long::valueOf);
//         converters.put(Double.class  , Double::valueOf);
//         converters.put(Float.class   , Float::valueOf);
//         converters.put(Boolean.class , Boolean::valueOf);
//     }
// 
//     public static <T> T convert(String value, Class<T> target) {
// 
//         T converted =
//             (T) converters.getOrDefault(target, v -> null)
//                           .apply(value);
// 
//         return converted;
//     }
// 
// }
// 
// Path: src/main/java/com/sulaco/fuse/config/route/Route.java
// public interface Route {
// 
//     public RouteHandler getHandler();
//     
//     public Map<String, String> getParams();
//     
//     public Optional<String> getParam(String name);
//     
// }
// 
// Path: src/main/java/com/sulaco/fuse/config/route/RouteHandler.java
// public class RouteHandler {
//     
//     Optional<ActorRef> actor;
//     
//     Optional<String>   methodName;
//     
//     HttpMethod httpMethod;
//     
//     
//     private RouteHandler() {
//         actor      = Optional.ofNullable(null);
//         methodName = Optional.ofNullable(null);
//         httpMethod = HttpMethod.GET;
//     }
// 
//     public static RouteHandlerBuilder builder() {
//         return new RouteHandlerBuilder();
//     }
//     
//     public RouteHandler(Optional<ActorRef> actor, String methodName) {
//         this.actor      = actor;
//         this.methodName = Optional.ofNullable(methodName);
//     }
// 
//     public Optional<ActorRef> getActor() {
//         return actor;
//     }
// 
//     public Optional<String> getMethodName() {
//         return methodName;
//     }
//     
//     public HttpMethod getHttpMethod() {
//         return httpMethod;
//     }
// 
// 
//     public static class RouteHandlerBuilder {
//         
//         private RouteHandler instance;
//         
//         public RouteHandlerBuilder() {
//             this.instance = new RouteHandler();
//         }
//         
//         public RouteHandlerBuilder withActorRef(Optional<ActorRef> actor) {
//             instance.actor = actor;
//             return this;
//         }
//         
//         public RouteHandlerBuilder withMethodName(String methodName) {
//             instance.methodName = Optional.ofNullable(methodName);
//             return this;
//         }
//         
//         public RouteHandlerBuilder withHttpMethod(String httpMethod) {
//             if (!StringUtils.isEmpty(httpMethod)) {
//                 try {
//                     instance.httpMethod = HttpMethod.valueOf(httpMethod);
//                 }
//                 catch (Exception ex) {
//                     log.warn("Invalid method specified:{}, defaulting to GET", httpMethod, ex);
//                     instance.httpMethod = HttpMethod.GET;
//                 }
//             }
//             return this;
//         }
//         
//         public RouteHandler build() {
//             return instance;
//         }
//     }
// 
//     private static final Logger log = LoggerFactory.getLogger(RouteHandler.class);
//     
// }


import com.sulaco.fuse.util.PrimitiveConverters;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.http.DefaultFullHttpRequest;
import io.netty.handler.codec.http.HttpRequest;
import java.nio.charset.Charset;
import java.util.Map;
import java.util.Optional;
import java.util.UUID;
import com.sulaco.fuse.config.route.Route;
import com.sulaco.fuse.config.route.RouteHandler;

package com.sulaco.fuse.akka.message;




public class FuseRequestMessageImpl implements FuseRequestMessage {

    long id;

    HttpRequest incomingRequest;

    ChannelHandlerContext channelContext;

    Route route;
    
    volatile boolean flushed = false;
    
    public FuseRequestMessageImpl(long id, ChannelHandlerContext context, HttpRequest request) {
        this.id = id;
        this.channelContext  = context;
        this.incomingRequest = request;
    }

    @Override
    public long getId() {
        return id;
    }

    @Override
    public HttpRequest getRequest() {
        return incomingRequest;
    }

    @Override
    public ChannelHandlerContext getChannelContext() {
        return channelContext;
    }

    @Override

// Path: src/main/java/com/sulaco/fuse/util/PrimitiveConverters.java
// @SuppressWarnings({"unchecked"})
// public class PrimitiveConverters {
// 
//     static Map<Class<?>, Function<String, ?>> converters = new HashMap<>();
//     static {
//         converters.put(Integer.class , Integer::valueOf);
//         converters.put(Long.class    , Long::valueOf);
//         converters.put(Double.class  , Double::valueOf);
//         converters.put(Float.class   , Float::valueOf);
//         converters.put(Boolean.class , Boolean::valueOf);
//     }
// 
//     public static <T> T convert(String value, Class<T> target) {
// 
//         T converted =
//             (T) converters.getOrDefault(target, v -> null)
//                           .apply(value);
// 
//         return converted;
//     }
// 
// }
// 
// Path: src/main/java/com/sulaco/fuse/config/route/Route.java
// public interface Route {
// 
//     public RouteHandler getHandler();
//     
//     public Map<String, String> getParams();
//     
//     public Optional<String> getParam(String name);
//     
// }
// 
// Path: src/main/java/com/sulaco/fuse/config/route/RouteHandler.java
// public class RouteHandler {
//     
//     Optional<ActorRef> actor;
//     
//     Optional<String>   methodName;
//     
//     HttpMethod httpMethod;
//     
//     
//     private RouteHandler() {
//         actor      = Optional.ofNullable(null);
//         methodName = Optional.ofNullable(null);
//         httpMethod = HttpMethod.GET;
//     }
// 
//     public static RouteHandlerBuilder builder() {
//         return new RouteHandlerBuilder();
//     }
//     
//     public RouteHandler(Optional<ActorRef> actor, String methodName) {
//         this.actor      = actor;
//         this.methodName = Optional.ofNullable(methodName);
//     }
// 
//     public Optional<ActorRef> getActor() {
//         return actor;
//     }
// 
//     public Optional<String> getMethodName() {
//         return methodName;
//     }
//     
//     public HttpMethod getHttpMethod() {
//         return httpMethod;
//     }
// 
// 
//     public static class RouteHandlerBuilder {
//         
//         private RouteHandler instance;
//         
//         public RouteHandlerBuilder() {
//             this.instance = new RouteHandler();
//         }
//         
//         public RouteHandlerBuilder withActorRef(Optional<ActorRef> actor) {
//             instance.actor = actor;
//             return this;
//         }
//         
//         public RouteHandlerBuilder withMethodName(String methodName) {
//             instance.methodName = Optional.ofNullable(methodName);
//             return this;
//         }
//         
//         public RouteHandlerBuilder withHttpMethod(String httpMethod) {
//             if (!StringUtils.isEmpty(httpMethod)) {
//                 try {
//                     instance.httpMethod = HttpMethod.valueOf(httpMethod);
//                 }
//                 catch (Exception ex) {
//                     log.warn("Invalid method specified:{}, defaulting to GET", httpMethod, ex);
//                     instance.httpMethod = HttpMethod.GET;
//                 }
//             }
//             return this;
//         }
//         
//         public RouteHandler build() {
//             return instance;
//         }
//     }
// 
//     private static final Logger log = LoggerFactory.getLogger(RouteHandler.class);
//     
// }


// Path: src/main/java/com/sulaco/fuse/akka/message/FuseRequestMessageImpl.java
import com.sulaco.fuse.util.PrimitiveConverters;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.http.DefaultFullHttpRequest;
import io.netty.handler.codec.http.HttpRequest;
import java.nio.charset.Charset;
import java.util.Map;
import java.util.Optional;
import java.util.UUID;
import com.sulaco.fuse.config.route.Route;
import com.sulaco.fuse.config.route.RouteHandler;

package com.sulaco.fuse.akka.message;




public class FuseRequestMessageImpl implements FuseRequestMessage {

    long id;

    HttpRequest incomingRequest;

    ChannelHandlerContext channelContext;

    Route route;
    
    volatile boolean flushed = false;
    
    public FuseRequestMessageImpl(long id, ChannelHandlerContext context, HttpRequest request) {
        this.id = id;
        this.channelContext  = context;
        this.incomingRequest = request;
    }

    @Override
    public long getId() {
        return id;
    }

    @Override
    public HttpRequest getRequest() {
        return incomingRequest;
    }

    @Override
    public ChannelHandlerContext getChannelContext() {
        return channelContext;
    }

    @Override

    public RouteHandler getHandler() {
