-
Notifications
You must be signed in to change notification settings - Fork 76
Expand file tree
/
Copy pathOAuthConfig.java
More file actions
31 lines (25 loc) · 917 Bytes
/
OAuthConfig.java
File metadata and controls
31 lines (25 loc) · 917 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package com.icoderman.woocommerce.oauth;
public final class OAuthConfig {
private final String url;
private final String consumerKey;
private final String consumerSecret;
public OAuthConfig(String url, String consumerKey, String consumerSecret) {
if (url == null || url.isEmpty() ||
consumerKey == null || consumerKey.isEmpty() ||
consumerSecret == null || consumerSecret.isEmpty()) {
throw new IllegalArgumentException("All arguments are required");
}
this.url = url.endsWith("/") ? url.substring(0, url.lastIndexOf("/")) : url;
this.consumerKey = consumerKey;
this.consumerSecret = consumerSecret;
}
public String getUrl() {
return url;
}
public String getConsumerKey() {
return consumerKey;
}
public String getConsumerSecret() {
return consumerSecret;
}
}