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; }
@HEAD("/users") @Headers("Content-type: application/json") Observable<Response> getLastModified();