All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.iprogrammerr.bright.server.request.ResolvedRequest Maven / Gradle / Ivy

package com.iprogrammerr.bright.server.request;

import com.iprogrammerr.bright.server.model.KeysValues;
import com.iprogrammerr.bright.server.model.StringsObjects;

public final class ResolvedRequest extends RequestEnvelope implements MatchedRequest {

    private final KeysValues parameters;
    private final KeysValues pathVariables;

    public ResolvedRequest(Request request, KeysValues parameters, KeysValues pathVariables) {
	super(request);
	this.parameters = parameters;
	this.pathVariables = pathVariables;
    }

    public ResolvedRequest(Request request) {
	this(request, new StringsObjects(), new StringsObjects());
    }

    @Override
    public  T parameter(String key, Class clazz) throws Exception {
	return parameters.value(key, clazz);
    }

    @Override
    public  T pathVariable(String key, Class clazz) throws Exception {
	return pathVariables.value(key, clazz);
    }

    @Override
    public  boolean hasParameter(String key, Class clazz) {
	return parameters.has(key, clazz);
    }

    @Override
    public  boolean hasPathVariable(String key, Class clazz) {
	return pathVariables.has(key, clazz);
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy