Package feign
Interface Target<T>
-
- Type Parameters:
T
- type of the interface this target applies to.
- All Known Implementing Classes:
Target.EmptyTarget
,Target.HardCodedTarget
public interface Target<T>
relationship to JAXRS 2.0
Similar tojavax.ws.rs.client.WebTarget
, as it produces requests. However,RequestTemplate
is a closer match toWebTarget
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
Target.EmptyTarget<T>
static class
Target.HardCodedTarget<T>
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Request
apply(RequestTemplate input)
Targets a template to this target, adding thebase url
and any target-specific headers or query parameters.java.lang.String
name()
java.lang.Class<T>
type()
java.lang.String
url()
-
-
-
Method Detail
-
type
java.lang.Class<T> type()
-
name
java.lang.String name()
-
url
java.lang.String url()
-
apply
Request apply(RequestTemplate input)
Targets a template to this target, adding thebase url
and any target-specific headers or query parameters.
For example:
public Request apply(RequestTemplate input) { input.insert(0, url()); input.replaceHeader("X-Auth", currentToken); return input.asRequest(); }
relationship to JAXRS 2.0
This call is similar tojavax.ws.rs.client.WebTarget.request()
, except that we expect transient, but necessary decoration to be applied on invocation.
-
-