|
1 | 1 | package com.github.scribejava.core.builder; |
2 | 2 |
|
| 3 | +import com.github.scribejava.core.builder.api.BaseApi; |
3 | 4 | import com.github.scribejava.core.builder.api.DefaultApi10a; |
4 | 5 | import com.github.scribejava.core.builder.api.DefaultApi20; |
5 | 6 | import com.github.scribejava.core.model.OAuthConfig; |
|
8 | 9 | import com.github.scribejava.core.model.SignatureType; |
9 | 10 | import com.github.scribejava.core.oauth.OAuth10aService; |
10 | 11 | import com.github.scribejava.core.oauth.OAuth20Service; |
| 12 | +import com.github.scribejava.core.oauth.OAuthService; |
11 | 13 | import com.github.scribejava.core.utils.Preconditions; |
12 | 14 |
|
13 | 15 | abstract class AbstractServiceBuilder<T extends AbstractServiceBuilder<T>> { |
@@ -176,22 +178,12 @@ public String getResponseType() { |
176 | 178 | protected abstract OAuthConfig createConfig(); |
177 | 179 |
|
178 | 180 | /** |
179 | | - * Returns the fully configured {@link OAuth10aService} |
| 181 | + * Returns the fully configured {@link S} |
180 | 182 | * |
181 | 183 | * @param api will build Service for this API |
182 | | - * @return fully configured {@link OAuth10aService} |
| 184 | + * @return fully configured {@link S} |
183 | 185 | */ |
184 | | - public OAuth10aService build(DefaultApi10a api) { |
185 | | - return api.createService(createConfig()); |
186 | | - } |
187 | | - |
188 | | - /** |
189 | | - * Returns the fully configured {@link OAuth20Service} |
190 | | - * |
191 | | - * @param api will build Service for this API |
192 | | - * @return fully configured {@link OAuth20Service} |
193 | | - */ |
194 | | - public OAuth20Service build(DefaultApi20 api) { |
| 186 | + public <S extends OAuthService> S build(BaseApi<S> api) { |
195 | 187 | return api.createService(createConfig()); |
196 | 188 | } |
197 | 189 | } |
0 commit comments