blob: 93bb8c5017cd75ebcf1cb6d2e1afd80d4c8d835a (
plain)
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
|
package com.p4square.ccbapi.model;
import java.time.LocalDate;
import java.util.Arrays;
/**
* GetIndividualProfilesRequest is the set of options for retrieving individual profiles.
*/
public class GetIndividualProfilesRequest {
// Used with individual_profiles
private LocalDate modifiedSince;
private Boolean includeInactive;
private int page;
private int perPage;
// Used with individual_profile_from_id
private int id;
// Used with individual_profile_from_login_password
private String login;
private char[] password;
// Used with individual_profile_from_micr
private String routingNumber;
private String accountNumber;
public int getId() {
return id;
}
/**
* Request the IndividualProfile for the given individual id.
*
* This option is mutually exclusive with {@link #withLoginPassword(String, char[])}
* and {@link #withMICR(String, String)}.
*
* @param id The id.
* @return this.
*/
public GetIndividualProfilesRequest withIndividualId(final int id) {
this.id = id;
this.password = new char[0];
this.login = this.accountNumber = this.routingNumber = null;
return this;
}
public String getLogin() {
return login;
}
public char[] getPassword() {
return password;
}
/**
* Request the IndividualProfile for the given login and password.
*
* This option is mutually exclusive with {@link #withIndividualId(int)}
* and {@link #withMICR(String, String)}.
*
* @param login The individual's login.
* @param password The individual's password.
* @return this.
*/
public GetIndividualProfilesRequest withLoginPassword(final String login, final char[] password) {
this.login = login;
this.password = password;
this.id = 0;
this.accountNumber = this.routingNumber = null;
return this;
}
public String getRoutingNumber() {
return routingNumber;
}
public String getAccountNumber() {
return accountNumber;
}
/**
* Request the IndividualProfile for the given bank account information.
*
* This option is mutually exclusive with {@link #withIndividualId(int)}
* and {@link #withLoginPassword(String, char[])}.
*
* @param routingNumber The individual's bank routing number.
* @param accountNumber The individual's bank account number.
* @return this.
*/
public GetIndividualProfilesRequest withMICR(final String routingNumber, final String accountNumber) {
this.routingNumber = routingNumber;
this.accountNumber = accountNumber;
return this;
}
public LocalDate getModifiedSince() {
return modifiedSince;
}
/**
* Request only IndividualProfiles modified since a given date.
*
* This option is only applicable when requesting all individuals.
*
* @param modifiedSince The date.
* @return this.
*/
public GetIndividualProfilesRequest withModifiedSince(final LocalDate modifiedSince) {
this.modifiedSince = modifiedSince;
return this;
}
public Boolean getIncludeInactive() {
return includeInactive;
}
public GetIndividualProfilesRequest withIncludeInactive(final boolean includeInactive) {
this.includeInactive = includeInactive;
return this;
}
public int getPage() {
return page;
}
/**
* Select the page of results when perPage is also specified.
*
* This option is only applicable when requesting all individuals.
*
* Defaults to 1 if {@link #withPerPage(int)} is specified on the request.
*
* @param page The starting page number.
* @return this.
*/
public GetIndividualProfilesRequest withPage(final int page) {
this.page = page;
return this;
}
public int getPerPage() {
return perPage;
}
/**
* Limit the number of IndividualProfiles returned.
*
* This option is only applicable when requesting all individuals.
*
* Defaults to 25 if {@link #withPage(int)} is specified on the request.
*
* @param perPage The maximum number to return.
* @return this.
*/
public GetIndividualProfilesRequest withPerPage(int perPage) {
this.perPage = perPage;
return this;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
GetIndividualProfilesRequest that = (GetIndividualProfilesRequest) o;
if (getPage() != that.getPage()) {
return false;
}
if (getPerPage() != that.getPerPage()) {
return false;
}
if (getId() != that.getId()) {
return false;
}
if (getModifiedSince() != null ?
!getModifiedSince().equals(that.getModifiedSince()) : that.getModifiedSince() != null) {
return false;
}
if (getIncludeInactive() != null ?
!getIncludeInactive().equals(that.getIncludeInactive()) : that.getIncludeInactive() != null) {
return false;
}
if (getLogin() != null ?
!getLogin().equals(that.getLogin()) : that.getLogin() != null) {
return false;
}
if (getPassword() != null ? !Arrays.equals(getPassword(), that.getPassword()) : that.getPassword() != null) {
return false;
}
if (getRoutingNumber() != null ?
!getRoutingNumber().equals(that.getRoutingNumber()) : that.getRoutingNumber() != null) {
return false;
}
return getAccountNumber() != null ?
getAccountNumber().equals(that.getAccountNumber()) : that.getAccountNumber() == null;
}
@Override
public int hashCode() {
int result = getModifiedSince() != null ? getModifiedSince().hashCode() : 0;
result = 31 * result + (getIncludeInactive() != null ? getIncludeInactive().hashCode() : 0);
result = 31 * result + getPage();
result = 31 * result + getPerPage();
result = 31 * result + getId();
result = 31 * result + (getLogin() != null ? getLogin().hashCode() : 0);
result = 31 * result + (getPassword() != null ? Arrays.hashCode(getPassword()) : 0);
result = 31 * result + (getRoutingNumber() != null ? getRoutingNumber().hashCode() : 0);
result = 31 * result + (getAccountNumber() != null ? getAccountNumber().hashCode() : 0);
return result;
}
}
|