Skip to content

Commit b33fd95

Browse files
authored
Merge pull request #529 from stripe/ob-flag-deprecated
Add Javadoc and deprecation notices
2 parents b33daef + 296d51b commit b33fd95

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+2810
-363
lines changed

build.gradle

+5-1
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,14 @@ group = GROUP
2626
version = VERSION_NAME
2727

2828
tasks.withType(JavaCompile) {
29-
options.compilerArgs << "-Xlint:all" << "-Xlint:-options" << "-Xlint:-processing" << "-Werror"
29+
options.compilerArgs << "-Xlint:all" << "-Xlint:-options" << "-Xlint:-processing"
3030
options.encoding = 'UTF-8'
3131
}
3232

33+
compileJava {
34+
options.compilerArgs << "-Werror"
35+
}
36+
3337
configurations.all {
3438
}
3539

src/main/java/com/stripe/model/Account.java

+81-4
Original file line numberDiff line numberDiff line change
@@ -75,99 +75,161 @@ public class Account extends APIResource implements HasId, MetadataStore<Account
7575
@Deprecated
7676
List<String> currenciesSupported;
7777

78+
// <editor-fold desc="all">
79+
/**
80+
* List all connected accounts.
81+
*
82+
* @deprecated Use the {@link #list(Map)} method instead.
83+
* This method will be removed in the next major version.
84+
*/
7885
@Deprecated
7986
public static AccountCollection all(Map<String, Object> params)
8087
throws AuthenticationException, InvalidRequestException,
8188
APIConnectionException, CardException, APIException {
8289
return list(params, null);
8390
}
8491

92+
/**
93+
* List all connected accounts.
94+
*
95+
* @deprecated Use the {@link #list(Map, RequestOptions)} method instead.
96+
* This method will be removed in the next major version.
97+
*/
8598
@Deprecated
8699
public static AccountCollection all(Map<String, Object> params, RequestOptions options)
87100
throws AuthenticationException, InvalidRequestException,
88101
APIConnectionException, CardException, APIException {
89102
return list(params, options);
90103
}
104+
// </editor-fold>
91105

106+
// <editor-fold desc="create">
107+
/**
108+
* Create an account.
109+
*/
92110
public static Account create(Map<String, Object> params)
93111
throws AuthenticationException, InvalidRequestException,
94112
APIConnectionException, CardException, APIException {
95113
return create(params, null);
96114
}
97115

116+
/**
117+
* Create an account.
118+
*/
98119
public static Account create(Map<String, Object> params, RequestOptions options)
99120
throws AuthenticationException, InvalidRequestException,
100121
APIConnectionException, CardException, APIException {
101122
return request(RequestMethod.POST, classURL(Account.class), params, Account.class, options);
102123
}
124+
// </editor-fold>
103125

126+
// <editor-fold desc="delete">
127+
/**
128+
* Delete an account.
129+
*/
104130
public DeletedAccount delete()
105131
throws AuthenticationException, InvalidRequestException,
106132
APIConnectionException, CardException, APIException {
107133
return delete(null, (RequestOptions) null);
108134
}
109135

136+
/**
137+
* Delete an account.
138+
*/
110139
public DeletedAccount delete(RequestOptions options)
111140
throws AuthenticationException, InvalidRequestException,
112141
APIConnectionException, CardException, APIException {
113142
return delete(null, options);
114143
}
115144

145+
/**
146+
* Delete an account.
147+
*/
116148
public DeletedAccount delete(Map<String, Object> params)
117149
throws AuthenticationException, InvalidRequestException,
118150
APIConnectionException, CardException, APIException {
119151
return delete(params, null);
120152
}
121153

154+
/**
155+
* Delete an account.
156+
*/
122157
public DeletedAccount delete(Map<String, Object> params, RequestOptions options)
123158
throws AuthenticationException, InvalidRequestException,
124159
APIConnectionException, CardException, APIException {
125160
return request(RequestMethod.DELETE, instanceURL(Account.class, this.id), params,
126161
DeletedAccount.class, options);
127162
}
163+
// </editor-fold>
128164

165+
// <editor-fold desc="list">
166+
/**
167+
* List all connected accounts.
168+
*/
129169
public static AccountCollection list(Map<String, Object> params)
130170
throws AuthenticationException, InvalidRequestException,
131171
APIConnectionException, CardException, APIException {
132172
return list(params, null);
133173
}
134174

175+
/**
176+
* List all connected accounts.
177+
*/
135178
public static AccountCollection list(Map<String, Object> params, RequestOptions options)
136179
throws AuthenticationException, InvalidRequestException,
137180
APIConnectionException, CardException, APIException {
138181
return requestCollection(classURL(Account.class), params, AccountCollection.class, options);
139182
}
183+
// </editor-fold>
140184

185+
// <editor-fold desc="reject">
186+
/**
187+
* Reject an account.
188+
*/
141189
public Account reject(Map<String, Object> params)
142190
throws AuthenticationException, InvalidRequestException,
143191
APIConnectionException, CardException, APIException {
144192
return reject(params, null);
145193
}
146194

195+
/**
196+
* Reject an account.
197+
*/
147198
public Account reject(Map<String, Object> params, RequestOptions options)
148199
throws AuthenticationException, InvalidRequestException,
149200
APIConnectionException, CardException, APIException {
150201
return request(RequestMethod.POST, String.format("%s/reject",
151202
instanceURL(Account.class, this.getId())), params, Account.class, options);
152203
}
204+
// </editor-fold>
153205

206+
// <editor-fold desc="retrieve">
207+
/**
208+
* Retrieve account details.
209+
*/
154210
public static Account retrieve()
155211
throws AuthenticationException, InvalidRequestException,
156212
APIConnectionException, CardException, APIException {
157213
return retrieve((RequestOptions) null);
158214
}
159215

216+
/**
217+
* Retrieve account details.
218+
*/
160219
public static Account retrieve(RequestOptions options)
161220
throws AuthenticationException, InvalidRequestException,
162221
APIConnectionException, CardException, APIException {
163222
return request(RequestMethod.GET, singleClassURL(Account.class), null, Account.class, options);
164223
}
165224

166225
/**
167-
* In order to preserve backwards-compatibility, this method does two things.
168-
* If the parameter looks like an API key (starts with sk_), retrieve the
169-
* account resource with no ID parameter set. Otherwise, use the String
170-
* parameter as the account ID.
226+
* Retrieve account details.
227+
*
228+
* @param apiKeyOrAccountId If the parameter looks like an API key (starts with "sk_"), retrieve
229+
* the account resource with no ID parameter set. Otherwise, use the String parameter as the
230+
* account ID.
231+
* @deprecated This method will only accept account IDs in the next major version. If you call
232+
* this method with API keys, use the {@link #retrieve(RequestOptions)} method instead.
171233
*/
172234
@Deprecated
173235
public static Account retrieve(String apiKeyOrAccountId)
@@ -180,33 +242,48 @@ public static Account retrieve(String apiKeyOrAccountId)
180242
}
181243
}
182244

245+
/**
246+
* Retrieve account details.
247+
*/
183248
public static Account retrieve(String id, RequestOptions options)
184249
throws AuthenticationException, InvalidRequestException,
185250
APIConnectionException, CardException, APIException {
186251
return request(RequestMethod.GET, instanceURL(Account.class, id), null, Account.class, options);
187252
}
188253

254+
/**
255+
* Retrieve account details.
256+
*/
189257
public static Account retrieve(String id, Map<String, Object> params, RequestOptions options)
190258
throws AuthenticationException, InvalidRequestException,
191259
APIConnectionException, CardException, APIException {
192260
return request(RequestMethod.GET, instanceURL(Account.class, id), params, Account.class,
193261
options);
194262
}
263+
// </editor-fold>
195264

265+
// <editor-fold desc="update">
266+
/**
267+
* Update an account.
268+
*/
196269
@Override
197270
public Account update(Map<String, Object> params)
198271
throws AuthenticationException, InvalidRequestException,
199272
APIConnectionException, CardException, APIException {
200273
return update(params, null);
201274
}
202275

276+
/**
277+
* Update an account.
278+
*/
203279
@Override
204280
public Account update(Map<String, Object> params, RequestOptions options)
205281
throws AuthenticationException, InvalidRequestException,
206282
APIConnectionException, CardException, APIException {
207283
return request(RequestMethod.POST, instanceURL(Account.class, this.id), params, Account.class,
208284
options);
209285
}
286+
// </editor-fold>
210287

211288
@Getter
212289
@Setter

src/main/java/com/stripe/model/ApplePayDomain.java

+32
Original file line numberDiff line numberDiff line change
@@ -25,54 +25,86 @@ public class ApplePayDomain extends APIResource implements HasId {
2525
String domainName;
2626
Boolean livemode;
2727

28+
// <editor-fold desc="create">
29+
/**
30+
* Create an Apple Pay domain.
31+
*/
2832
public static ApplePayDomain create(Map<String, Object> params)
2933
throws AuthenticationException, InvalidRequestException,
3034
APIConnectionException, CardException, APIException {
3135
return create(params, null);
3236
}
3337

38+
/**
39+
* Create an Apple Pay domain.
40+
*/
3441
public static ApplePayDomain create(Map<String, Object> params, RequestOptions options)
3542
throws AuthenticationException, InvalidRequestException,
3643
APIConnectionException, CardException, APIException {
3744
return request(RequestMethod.POST, getClassURL(), params, ApplePayDomain.class, options);
3845
}
46+
// </editor-fold>
3947

48+
// <editor-fold desc="delete">
49+
/**
50+
* Delete an Apple Pay domain.
51+
*/
4052
public DeletedApplePayDomain delete() throws AuthenticationException,
4153
InvalidRequestException, APIConnectionException, CardException,
4254
APIException {
4355
return delete(null);
4456
}
4557

58+
/**
59+
* Delete an Apple Pay domain.
60+
*/
4661
public DeletedApplePayDomain delete(RequestOptions options) throws AuthenticationException,
4762
InvalidRequestException, APIConnectionException, CardException,
4863
APIException {
4964
return request(RequestMethod.DELETE, getInstanceURL(id), null, DeletedApplePayDomain.class,
5065
options);
5166
}
67+
// </editor-fold>
5268

69+
// <editor-fold desc="list">
70+
/**
71+
* List all Apple Pay domains.
72+
*/
5373
public static ApplePayDomainCollection list(Map<String, Object> params)
5474
throws AuthenticationException, InvalidRequestException,
5575
APIConnectionException, CardException, APIException {
5676
return list(params, null);
5777
}
5878

79+
/**
80+
* List all Apple Pay domains.
81+
*/
5982
public static ApplePayDomainCollection list(Map<String, Object> params, RequestOptions options)
6083
throws AuthenticationException, InvalidRequestException,
6184
APIConnectionException, CardException, APIException {
6285
return requestCollection(getClassURL(), params, ApplePayDomainCollection.class, options);
6386
}
87+
// </editor-fold>
6488

89+
// <editor-fold desc="retrieve">
90+
/**
91+
* Retrieve an Apple Pay domain.
92+
*/
6593
public static ApplePayDomain retrieve(String id) throws AuthenticationException,
6694
InvalidRequestException, APIConnectionException, CardException,
6795
APIException {
6896
return retrieve(id, null);
6997
}
7098

99+
/**
100+
* Retrieve an Apple Pay domain.
101+
*/
71102
public static ApplePayDomain retrieve(String id, RequestOptions options)
72103
throws AuthenticationException, InvalidRequestException,
73104
APIConnectionException, CardException, APIException {
74105
return request(RequestMethod.GET, getInstanceURL(id), null, ApplePayDomain.class, options);
75106
}
107+
// </editor-fold>
76108

77109
private static String getClassURL() {
78110
return String.format("%s/v1/%s", Stripe.getApiBase(), "apple_pay/domains");

0 commit comments

Comments
 (0)