Browse Source

Merge pull request #154 from Netflix/adrian.builder-api-parity

Backports Feign.Builder.build() which exists in Feign 8.0
pull/156/head
Adrian Cole 10 years ago
parent
commit
d96813e530
  1. 3
      CHANGELOG.md
  2. 8
      core/src/main/java/feign/Feign.java

3
CHANGELOG.md

@ -1,3 +1,6 @@ @@ -1,3 +1,6 @@
### Version 7.2
* Backports `Feign.Builder.build()` which exists in Feign 8.0.
### Version 7.1
* Introduces feign.@Param to annotate template parameters. Users must migrate from `javax.inject.@Named` to `feign.@Param` before updating to Feign 8.0.
* Supports custom expansion via `@Param(value = "name", expander = CustomExpander.class)`

8
core/src/main/java/feign/Feign.java

@ -258,11 +258,15 @@ public abstract class Feign { @@ -258,11 +258,15 @@ public abstract class Feign {
}
public <T> T target(Class<T> apiType, String url) {
return target(new HardCodedTarget<T>(apiType, url));
return build().newInstance(new HardCodedTarget<T>(apiType, url));
}
public <T> T target(Target<T> target) {
return ObjectGraph.create(this).get(Feign.class).newInstance(target);
return build().newInstance(target);
}
public Feign build() {
return ObjectGraph.create(this).get(Feign.class);
}
@Provides Logger.Level logLevel() {

Loading…
Cancel
Save