Skip to content

Commit 6e3d2a2

Browse files
committed
improve LinkedInApi interface
1 parent 04f6967 commit 6e3d2a2

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

scribejava-apis/src/main/java/com/github/scribejava/apis/LinkedInApi.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,22 @@ public class LinkedInApi extends DefaultApi10a {
1010

1111
private final String scopesAsString;
1212

13+
/**
14+
* @deprecated use {@link #instance() }
15+
*/
16+
@Deprecated
17+
//TODO: make protected in the next release
1318
public LinkedInApi() {
1419
scopesAsString = null;
1520
}
1621

22+
/**
23+
* @deprecated use {@link #instance(java.lang.String...) }
24+
*/
25+
@Deprecated
26+
//TODO: make protected in the next release
1727
public LinkedInApi(String... scopes) {
28+
//TODO: deprecated check
1829
if (scopes == null || scopes.length == 0) {
1930
scopesAsString = null;
2031
} else {
@@ -35,6 +46,10 @@ public static LinkedInApi instance() {
3546
return InstanceHolder.INSTANCE;
3647
}
3748

49+
public static LinkedInApi instance(String... scopes) {
50+
return scopes == null || scopes.length == 0 ? instance() : new LinkedInApi(scopes);
51+
}
52+
3853
@Override
3954
public String getAccessTokenEndpoint() {
4055
return "https://api.linkedin.com/uas/oauth/accessToken";

0 commit comments

Comments
 (0)