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

com.github.nezha.httpfetch.resolver.UrlParameterResolver Maven / Gradle / Ivy

There is a newer version: 1.2.0
Show newest version
package com.github.nezha.httpfetch.resolver;

import com.github.nezha.httpfetch.HttpApiMethodWrapper;
import com.github.nezha.httpfetch.HttpApiRequestParam;
import com.github.nezha.httpfetch.RequestParameter;

/**
 * Created by daiqiang on 17/6/19.
 */
public class UrlParameterResolver implements MethodParameterResolver {

    @Override
    public boolean supperts(HttpApiMethodWrapper wrapper, RequestParameter requestParameter) {
        return requestParameter.getParameterWrapper().hasAnnotation(URL.class) && requestParameter.getParameter() instanceof String;
    }

    @Override
    public boolean resolveArgument(HttpApiRequestParam param, HttpApiMethodWrapper wrapper, RequestParameter requestParameter) {
        param.setUrl(requestParameter.getParameter().toString());
        return false;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy