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.FileConfigDbm;
24  
25  /**
26   * ${table.comment}
27   * @author ESFlute (using FreeGen)
28   */
29  public class BsFileConfig 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      /** available */
41      protected Boolean available;
42  
43      /** boost */
44      protected Float boost;
45  
46      /** configParameter */
47      protected String configParameter;
48  
49      /** createdBy */
50      protected String createdBy;
51  
52      /** createdTime */
53      protected Long createdTime;
54  
55      /** depth */
56      protected Integer depth;
57  
58      /** description */
59      protected String description;
60  
61      /** excludedDocPaths */
62      protected String excludedDocPaths;
63  
64      /** excludedPaths */
65      protected String excludedPaths;
66  
67      /** includedDocPaths */
68      protected String includedDocPaths;
69  
70      /** includedPaths */
71      protected String includedPaths;
72  
73      /** intervalTime */
74      protected Integer intervalTime;
75  
76      /** maxAccessCount */
77      protected Long maxAccessCount;
78  
79      /** name */
80      protected String name;
81  
82      /** numOfThread */
83      protected Integer numOfThread;
84  
85      /** paths */
86      protected String paths;
87  
88      /** permissions */
89      protected String[] permissions;
90  
91      /** sortOrder */
92      protected Integer sortOrder;
93  
94      /** timeToLive */
95      protected Integer timeToLive;
96  
97      /** updatedBy */
98      protected String updatedBy;
99  
100     /** updatedTime */
101     protected Long updatedTime;
102 
103     /** virtualHosts */
104     protected String[] virtualHosts;
105 
106     // [Referrers] *comment only
107 
108     // ===================================================================================
109     //                                                                             DB Meta
110     //                                                                             =======
111     @Override
112     public FileConfigDbm asDBMeta() {
113         return FileConfigDbm.getInstance();
114     }
115 
116     @Override
117     public String asTableDbName() {
118         return "file_config";
119     }
120 
121     // ===================================================================================
122     //                                                                              Source
123     //                                                                              ======
124     @Override
125     public Map<String, Object> toSource() {
126         Map<String, Object> sourceMap = new HashMap<>();
127         if (available != null) {
128             addFieldToSource(sourceMap, "available", available);
129         }
130         if (boost != null) {
131             addFieldToSource(sourceMap, "boost", boost);
132         }
133         if (configParameter != null) {
134             addFieldToSource(sourceMap, "configParameter", configParameter);
135         }
136         if (createdBy != null) {
137             addFieldToSource(sourceMap, "createdBy", createdBy);
138         }
139         if (createdTime != null) {
140             addFieldToSource(sourceMap, "createdTime", createdTime);
141         }
142         if (depth != null) {
143             addFieldToSource(sourceMap, "depth", depth);
144         }
145         if (description != null) {
146             addFieldToSource(sourceMap, "description", description);
147         }
148         if (excludedDocPaths != null) {
149             addFieldToSource(sourceMap, "excludedDocPaths", excludedDocPaths);
150         }
151         if (excludedPaths != null) {
152             addFieldToSource(sourceMap, "excludedPaths", excludedPaths);
153         }
154         if (includedDocPaths != null) {
155             addFieldToSource(sourceMap, "includedDocPaths", includedDocPaths);
156         }
157         if (includedPaths != null) {
158             addFieldToSource(sourceMap, "includedPaths", includedPaths);
159         }
160         if (intervalTime != null) {
161             addFieldToSource(sourceMap, "intervalTime", intervalTime);
162         }
163         if (maxAccessCount != null) {
164             addFieldToSource(sourceMap, "maxAccessCount", maxAccessCount);
165         }
166         if (name != null) {
167             addFieldToSource(sourceMap, "name", name);
168         }
169         if (numOfThread != null) {
170             addFieldToSource(sourceMap, "numOfThread", numOfThread);
171         }
172         if (paths != null) {
173             addFieldToSource(sourceMap, "paths", paths);
174         }
175         if (permissions != null) {
176             addFieldToSource(sourceMap, "permissions", permissions);
177         }
178         if (sortOrder != null) {
179             addFieldToSource(sourceMap, "sortOrder", sortOrder);
180         }
181         if (timeToLive != null) {
182             addFieldToSource(sourceMap, "timeToLive", timeToLive);
183         }
184         if (updatedBy != null) {
185             addFieldToSource(sourceMap, "updatedBy", updatedBy);
186         }
187         if (updatedTime != null) {
188             addFieldToSource(sourceMap, "updatedTime", updatedTime);
189         }
190         if (virtualHosts != null) {
191             addFieldToSource(sourceMap, "virtualHosts", virtualHosts);
192         }
193         return sourceMap;
194     }
195 
196     protected void addFieldToSource(Map<String, Object> sourceMap, String field, Object value) {
197         sourceMap.put(field, value);
198     }
199 
200     // ===================================================================================
201     //                                                                      Basic Override
202     //                                                                      ==============
203     @Override
204     protected String doBuildColumnString(String dm) {
205         StringBuilder sb = new StringBuilder();
206         sb.append(dm).append(available);
207         sb.append(dm).append(boost);
208         sb.append(dm).append(configParameter);
209         sb.append(dm).append(createdBy);
210         sb.append(dm).append(createdTime);
211         sb.append(dm).append(depth);
212         sb.append(dm).append(description);
213         sb.append(dm).append(excludedDocPaths);
214         sb.append(dm).append(excludedPaths);
215         sb.append(dm).append(includedDocPaths);
216         sb.append(dm).append(includedPaths);
217         sb.append(dm).append(intervalTime);
218         sb.append(dm).append(maxAccessCount);
219         sb.append(dm).append(name);
220         sb.append(dm).append(numOfThread);
221         sb.append(dm).append(paths);
222         sb.append(dm).append(permissions);
223         sb.append(dm).append(sortOrder);
224         sb.append(dm).append(timeToLive);
225         sb.append(dm).append(updatedBy);
226         sb.append(dm).append(updatedTime);
227         sb.append(dm).append(virtualHosts);
228         if (sb.length() > dm.length()) {
229             sb.delete(0, dm.length());
230         }
231         sb.insert(0, "{").append("}");
232         return sb.toString();
233     }
234 
235     // ===================================================================================
236     //                                                                            Accessor
237     //                                                                            ========
238     public Boolean getAvailable() {
239         checkSpecifiedProperty("available");
240         return available;
241     }
242 
243     public void setAvailable(Boolean value) {
244         registerModifiedProperty("available");
245         this.available = value;
246     }
247 
248     public Float getBoost() {
249         checkSpecifiedProperty("boost");
250         return boost;
251     }
252 
253     public void setBoost(Float value) {
254         registerModifiedProperty("boost");
255         this.boost = value;
256     }
257 
258     public String getConfigParameter() {
259         checkSpecifiedProperty("configParameter");
260         return convertEmptyToNull(configParameter);
261     }
262 
263     public void setConfigParameter(String value) {
264         registerModifiedProperty("configParameter");
265         this.configParameter = value;
266     }
267 
268     public String getCreatedBy() {
269         checkSpecifiedProperty("createdBy");
270         return convertEmptyToNull(createdBy);
271     }
272 
273     public void setCreatedBy(String value) {
274         registerModifiedProperty("createdBy");
275         this.createdBy = value;
276     }
277 
278     public Long getCreatedTime() {
279         checkSpecifiedProperty("createdTime");
280         return createdTime;
281     }
282 
283     public void setCreatedTime(Long value) {
284         registerModifiedProperty("createdTime");
285         this.createdTime = value;
286     }
287 
288     public Integer getDepth() {
289         checkSpecifiedProperty("depth");
290         return depth;
291     }
292 
293     public void setDepth(Integer value) {
294         registerModifiedProperty("depth");
295         this.depth = value;
296     }
297 
298     public String getDescription() {
299         checkSpecifiedProperty("description");
300         return convertEmptyToNull(description);
301     }
302 
303     public void setDescription(String value) {
304         registerModifiedProperty("description");
305         this.description = value;
306     }
307 
308     public String getExcludedDocPaths() {
309         checkSpecifiedProperty("excludedDocPaths");
310         return convertEmptyToNull(excludedDocPaths);
311     }
312 
313     public void setExcludedDocPaths(String value) {
314         registerModifiedProperty("excludedDocPaths");
315         this.excludedDocPaths = value;
316     }
317 
318     public String getExcludedPaths() {
319         checkSpecifiedProperty("excludedPaths");
320         return convertEmptyToNull(excludedPaths);
321     }
322 
323     public void setExcludedPaths(String value) {
324         registerModifiedProperty("excludedPaths");
325         this.excludedPaths = value;
326     }
327 
328     public String getIncludedDocPaths() {
329         checkSpecifiedProperty("includedDocPaths");
330         return convertEmptyToNull(includedDocPaths);
331     }
332 
333     public void setIncludedDocPaths(String value) {
334         registerModifiedProperty("includedDocPaths");
335         this.includedDocPaths = value;
336     }
337 
338     public String getIncludedPaths() {
339         checkSpecifiedProperty("includedPaths");
340         return convertEmptyToNull(includedPaths);
341     }
342 
343     public void setIncludedPaths(String value) {
344         registerModifiedProperty("includedPaths");
345         this.includedPaths = value;
346     }
347 
348     public Integer getIntervalTime() {
349         checkSpecifiedProperty("intervalTime");
350         return intervalTime;
351     }
352 
353     public void setIntervalTime(Integer value) {
354         registerModifiedProperty("intervalTime");
355         this.intervalTime = value;
356     }
357 
358     public Long getMaxAccessCount() {
359         checkSpecifiedProperty("maxAccessCount");
360         return maxAccessCount;
361     }
362 
363     public void setMaxAccessCount(Long value) {
364         registerModifiedProperty("maxAccessCount");
365         this.maxAccessCount = value;
366     }
367 
368     public String getName() {
369         checkSpecifiedProperty("name");
370         return convertEmptyToNull(name);
371     }
372 
373     public void setName(String value) {
374         registerModifiedProperty("name");
375         this.name = value;
376     }
377 
378     public Integer getNumOfThread() {
379         checkSpecifiedProperty("numOfThread");
380         return numOfThread;
381     }
382 
383     public void setNumOfThread(Integer value) {
384         registerModifiedProperty("numOfThread");
385         this.numOfThread = value;
386     }
387 
388     public String getPaths() {
389         checkSpecifiedProperty("paths");
390         return convertEmptyToNull(paths);
391     }
392 
393     public void setPaths(String value) {
394         registerModifiedProperty("paths");
395         this.paths = value;
396     }
397 
398     public String[] getPermissions() {
399         checkSpecifiedProperty("permissions");
400         return permissions;
401     }
402 
403     public void setPermissions(String[] value) {
404         registerModifiedProperty("permissions");
405         this.permissions = value;
406     }
407 
408     public Integer getSortOrder() {
409         checkSpecifiedProperty("sortOrder");
410         return sortOrder;
411     }
412 
413     public void setSortOrder(Integer value) {
414         registerModifiedProperty("sortOrder");
415         this.sortOrder = value;
416     }
417 
418     public Integer getTimeToLive() {
419         checkSpecifiedProperty("timeToLive");
420         return timeToLive;
421     }
422 
423     public void setTimeToLive(Integer value) {
424         registerModifiedProperty("timeToLive");
425         this.timeToLive = value;
426     }
427 
428     public String getUpdatedBy() {
429         checkSpecifiedProperty("updatedBy");
430         return convertEmptyToNull(updatedBy);
431     }
432 
433     public void setUpdatedBy(String value) {
434         registerModifiedProperty("updatedBy");
435         this.updatedBy = value;
436     }
437 
438     public Long getUpdatedTime() {
439         checkSpecifiedProperty("updatedTime");
440         return updatedTime;
441     }
442 
443     public void setUpdatedTime(Long value) {
444         registerModifiedProperty("updatedTime");
445         this.updatedTime = value;
446     }
447 
448     public String[] getVirtualHosts() {
449         checkSpecifiedProperty("virtualHosts");
450         return virtualHosts;
451     }
452 
453     public void setVirtualHosts(String[] value) {
454         registerModifiedProperty("virtualHosts");
455         this.virtualHosts = value;
456     }
457 }