View Javadoc
1   /*
2    * Copyright 2012-2025 CodeLibs Project and the Others.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
13   * either express or implied. See the License for the specific language
14   * governing permissions and limitations under the License.
15   */
16  package org.codelibs.fess.opensearch.config.bsentity;
17  
18  import java.time.LocalDateTime;
19  import java.util.HashMap;
20  import java.util.Map;
21  
22  import org.codelibs.fess.opensearch.config.allcommon.EsAbstractEntity;
23  import org.codelibs.fess.opensearch.config.bsentity.dbmeta.WebAuthenticationDbm;
24  
25  /**
26   * ${table.comment}
27   * @author ESFlute (using FreeGen)
28   */
29  public class BsWebAuthentication extends EsAbstractEntity {
30  
31      // ===================================================================================
32      //                                                                          Definition
33      //                                                                          ==========
34      private static final long serialVersionUID = 1L;
35      protected static final Class<?> suppressUnusedImportLocalDateTime = LocalDateTime.class;
36  
37      // ===================================================================================
38      //                                                                           Attribute
39      //                                                                           =========
40      /** authRealm */
41      protected String authRealm;
42  
43      /** createdBy */
44      protected String createdBy;
45  
46      /** createdTime */
47      protected Long createdTime;
48  
49      /** hostname */
50      protected String hostname;
51  
52      /** parameters */
53      protected String parameters;
54  
55      /** password */
56      protected String password;
57  
58      /** port */
59      protected Integer port;
60  
61      /** protocolScheme */
62      protected String protocolScheme;
63  
64      /** updatedBy */
65      protected String updatedBy;
66  
67      /** updatedTime */
68      protected Long updatedTime;
69  
70      /** username */
71      protected String username;
72  
73      /** webConfigId */
74      protected String webConfigId;
75  
76      // [Referrers] *comment only
77  
78      // ===================================================================================
79      //                                                                             DB Meta
80      //                                                                             =======
81      @Override
82      public WebAuthenticationDbm asDBMeta() {
83          return WebAuthenticationDbm.getInstance();
84      }
85  
86      @Override
87      public String asTableDbName() {
88          return "web_authentication";
89      }
90  
91      // ===================================================================================
92      //                                                                              Source
93      //                                                                              ======
94      @Override
95      public Map<String, Object> toSource() {
96          Map<String, Object> sourceMap = new HashMap<>();
97          if (authRealm != null) {
98              addFieldToSource(sourceMap, "authRealm", authRealm);
99          }
100         if (createdBy != null) {
101             addFieldToSource(sourceMap, "createdBy", createdBy);
102         }
103         if (createdTime != null) {
104             addFieldToSource(sourceMap, "createdTime", createdTime);
105         }
106         if (hostname != null) {
107             addFieldToSource(sourceMap, "hostname", hostname);
108         }
109         if (parameters != null) {
110             addFieldToSource(sourceMap, "parameters", parameters);
111         }
112         if (password != null) {
113             addFieldToSource(sourceMap, "password", password);
114         }
115         if (port != null) {
116             addFieldToSource(sourceMap, "port", port);
117         }
118         if (protocolScheme != null) {
119             addFieldToSource(sourceMap, "protocolScheme", protocolScheme);
120         }
121         if (updatedBy != null) {
122             addFieldToSource(sourceMap, "updatedBy", updatedBy);
123         }
124         if (updatedTime != null) {
125             addFieldToSource(sourceMap, "updatedTime", updatedTime);
126         }
127         if (username != null) {
128             addFieldToSource(sourceMap, "username", username);
129         }
130         if (webConfigId != null) {
131             addFieldToSource(sourceMap, "webConfigId", webConfigId);
132         }
133         return sourceMap;
134     }
135 
136     protected void addFieldToSource(Map<String, Object> sourceMap, String field, Object value) {
137         sourceMap.put(field, value);
138     }
139 
140     // ===================================================================================
141     //                                                                      Basic Override
142     //                                                                      ==============
143     @Override
144     protected String doBuildColumnString(String dm) {
145         StringBuilder sb = new StringBuilder();
146         sb.append(dm).append(authRealm);
147         sb.append(dm).append(createdBy);
148         sb.append(dm).append(createdTime);
149         sb.append(dm).append(hostname);
150         sb.append(dm).append(parameters);
151         sb.append(dm).append(password);
152         sb.append(dm).append(port);
153         sb.append(dm).append(protocolScheme);
154         sb.append(dm).append(updatedBy);
155         sb.append(dm).append(updatedTime);
156         sb.append(dm).append(username);
157         sb.append(dm).append(webConfigId);
158         if (sb.length() > dm.length()) {
159             sb.delete(0, dm.length());
160         }
161         sb.insert(0, "{").append("}");
162         return sb.toString();
163     }
164 
165     // ===================================================================================
166     //                                                                            Accessor
167     //                                                                            ========
168     public String getAuthRealm() {
169         checkSpecifiedProperty("authRealm");
170         return convertEmptyToNull(authRealm);
171     }
172 
173     public void setAuthRealm(String value) {
174         registerModifiedProperty("authRealm");
175         this.authRealm = value;
176     }
177 
178     public String getCreatedBy() {
179         checkSpecifiedProperty("createdBy");
180         return convertEmptyToNull(createdBy);
181     }
182 
183     public void setCreatedBy(String value) {
184         registerModifiedProperty("createdBy");
185         this.createdBy = value;
186     }
187 
188     public Long getCreatedTime() {
189         checkSpecifiedProperty("createdTime");
190         return createdTime;
191     }
192 
193     public void setCreatedTime(Long value) {
194         registerModifiedProperty("createdTime");
195         this.createdTime = value;
196     }
197 
198     public String getHostname() {
199         checkSpecifiedProperty("hostname");
200         return convertEmptyToNull(hostname);
201     }
202 
203     public void setHostname(String value) {
204         registerModifiedProperty("hostname");
205         this.hostname = value;
206     }
207 
208     public String getParameters() {
209         checkSpecifiedProperty("parameters");
210         return convertEmptyToNull(parameters);
211     }
212 
213     public void setParameters(String value) {
214         registerModifiedProperty("parameters");
215         this.parameters = value;
216     }
217 
218     public String getPassword() {
219         checkSpecifiedProperty("password");
220         return convertEmptyToNull(password);
221     }
222 
223     public void setPassword(String value) {
224         registerModifiedProperty("password");
225         this.password = value;
226     }
227 
228     public Integer getPort() {
229         checkSpecifiedProperty("port");
230         return port;
231     }
232 
233     public void setPort(Integer value) {
234         registerModifiedProperty("port");
235         this.port = value;
236     }
237 
238     public String getProtocolScheme() {
239         checkSpecifiedProperty("protocolScheme");
240         return convertEmptyToNull(protocolScheme);
241     }
242 
243     public void setProtocolScheme(String value) {
244         registerModifiedProperty("protocolScheme");
245         this.protocolScheme = value;
246     }
247 
248     public String getUpdatedBy() {
249         checkSpecifiedProperty("updatedBy");
250         return convertEmptyToNull(updatedBy);
251     }
252 
253     public void setUpdatedBy(String value) {
254         registerModifiedProperty("updatedBy");
255         this.updatedBy = value;
256     }
257 
258     public Long getUpdatedTime() {
259         checkSpecifiedProperty("updatedTime");
260         return updatedTime;
261     }
262 
263     public void setUpdatedTime(Long value) {
264         registerModifiedProperty("updatedTime");
265         this.updatedTime = value;
266     }
267 
268     public String getUsername() {
269         checkSpecifiedProperty("username");
270         return convertEmptyToNull(username);
271     }
272 
273     public void setUsername(String value) {
274         registerModifiedProperty("username");
275         this.username = value;
276     }
277 
278     public String getWebConfigId() {
279         checkSpecifiedProperty("webConfigId");
280         return convertEmptyToNull(webConfigId);
281     }
282 
283     public void setWebConfigId(String value) {
284         registerModifiedProperty("webConfigId");
285         this.webConfigId = value;
286     }
287 }