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

vip.justlive.oxygen.web.router.RoutingContext Maven / Gradle / Ivy

There is a newer version: 3.0.9
Show newest version
/*
 * Copyright (C) 2020 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */
package vip.justlive.oxygen.web.router;

import vip.justlive.oxygen.web.http.Request;
import vip.justlive.oxygen.web.http.Response;

/**
 * 路由上下文
 *
 * @author wubo
 */
public interface RoutingContext {

  /**
   * 获取 request
   *
   * @return request
   */
  Request request();

  /**
   * 获取response
   *
   * @return response
   */
  Response response();

  /**
   * 请求路径
   *
   * @return path
   */
  String requestPath();

  /**
   * param参数绑定
   *
   * @param clazz 类型
   * @param  泛型
   * @return obj
   */
   T bindParam(Class clazz);

  /**
   * cookie参数绑定
   *
   * @param clazz 类型
   * @param  泛型
   * @return obj
   */
   T bindCookie(Class clazz);

  /**
   * header参数绑定
   *
   * @param clazz 类型
   * @param  泛型
   * @return obj
   */
   T bindHeader(Class clazz);

  /**
   * path参数绑定
   *
   * @param clazz 类型
   * @param  泛型
   * @return obj
   */
   T bindPathVariables(Class clazz);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy