Java 类retrofit.http.HEAD 实例源码

项目:mocktopus    文件:Options.java   
public FlattenedOptions flatten() {
    FlattenedOptions flattenedOptions = new FlattenedOptions();
    Set<Method> methodSet = methodOptions.keySet();
    for (Method method : methodSet) {
        //add method to flattenedOptions
        String endpoint = "";
        if (method.getAnnotation(GET.class) != null)
            endpoint += method.getAnnotation(GET.class).value();
        if (method.getAnnotation(POST.class) != null)
            endpoint += method.getAnnotation(POST.class).value();
        if (method.getAnnotation(PUT.class) != null)
            endpoint += method.getAnnotation(PUT.class).value();
        if (method.getAnnotation(DELETE.class) != null)
            endpoint += method.getAnnotation(DELETE.class).value();
        if (method.getAnnotation(HEAD.class) != null)
            endpoint += method.getAnnotation(HEAD.class).value();

        flattenedOptions.addMethod(method, endpoint);
        //add fields to flattenedOptions
        methodOptions.get(method).addToFlattenedOptions(flattenedOptions);
    }

    log("done flattening, contains " + flattenedOptions.itemList.size() + " items");
    return flattenedOptions;
}
项目:amos-ss15-proj2    文件:UsersHeadResource.java   
@HEAD("/users")
@Headers("Content-type: application/json")
Observable<Response> getLastModified();