This repository has been archived by the owner on Jan 11, 2024. It is now read-only.
/
EmailConfiguration.java
177 lines (151 loc) · 4.67 KB
/
EmailConfiguration.java
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
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.fineract.cn.notification.api.v1.domain;
import org.apache.fineract.cn.lang.validation.constraints.ValidIdentifier;
import org.hibernate.validator.constraints.Length;
import java.util.Objects;
@SuppressWarnings({"WeakerAccess", "unused"})
public class EmailConfiguration {
@ValidIdentifier
@Length(max = 45)
private String identifier;
@Length(max = 45)
private String host;
@Length(max = 45)
private String port;
@Length(max = 45)
private String protocol;
@Length(max = 45)
private String username;
@Length(max = 255)
private String app_password;
@Length(max = 45)
private String smtp_auth;
@Length(max = 45)
private String start_tls;
@Length(max = 10)
private String state;
public EmailConfiguration() {
super();
}
public static EmailConfiguration create(String identifier,
String host, String port,
String protocol, String username,
String app_password, String smtp_auth,
String start_tls, String state) {
EmailConfiguration emailConfiguration = new EmailConfiguration();
emailConfiguration.setIdentifier(identifier);
emailConfiguration.setHost(host);
emailConfiguration.setPort(port);
emailConfiguration.setProtocol(protocol);
emailConfiguration.setUsername(username);
emailConfiguration.setApp_password(app_password);
emailConfiguration.setSmtp_auth(smtp_auth);
emailConfiguration.setStart_tls(start_tls);
emailConfiguration.setState(state);
return emailConfiguration;
}
public String getIdentifier() {
return identifier;
}
public void setIdentifier(String identifier) {
this.identifier = identifier;
}
public String getHost() {
return host;
}
public void setHost(String host) {
this.host = host;
}
public String getPort() {
return port;
}
public void setPort(String port) {
this.port = port;
}
public String getProtocol() {
return protocol;
}
public void setProtocol(String protocol) {
this.protocol = protocol;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getApp_password() {
return app_password;
}
public void setApp_password(String app_password) {
this.app_password = app_password;
}
public String getSmtp_auth() {
return smtp_auth;
}
public void setSmtp_auth(String smtp_auth) {
this.smtp_auth = smtp_auth;
}
public String getStart_tls() {
return start_tls;
}
public void setStart_tls(String start_tls) {
this.start_tls = start_tls;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
EmailConfiguration that = (EmailConfiguration) o;
return Objects.equals(identifier, that.identifier) &&
Objects.equals(host, that.host) &&
Objects.equals(port, that.port) &&
Objects.equals(protocol, that.protocol) &&
Objects.equals(username, that.username) &&
Objects.equals(app_password, that.app_password) &&
Objects.equals(smtp_auth, that.smtp_auth) &&
Objects.equals(start_tls, that.start_tls) &&
Objects.equals(state, that.state);
}
@Override
public int hashCode() {
return Objects.hash(identifier, host, port, protocol, username, app_password, smtp_auth, start_tls, state);
}
@Override
public String toString() {
return "EmailConfiguration{" +
"identifier='" + identifier + '\'' +
", host='" + host + '\'' +
", port='" + port + '\'' +
", protocol='" + protocol + '\'' +
", username='" + username + '\'' +
", app_password='" + app_password + '\'' +
", smtp_auth='" + smtp_auth + '\'' +
", start_tls='" + start_tls + '\'' +
", state='" + state + '\'' +
'}';
}
}