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.DataConfigDbm;
24  
25  /**
26   * ${table.comment}
27   * @author ESFlute (using FreeGen)
28   */
29  public class BsDataConfig 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      /** createdBy */
47      protected String createdBy;
48  
49      /** createdTime */
50      protected Long createdTime;
51  
52      /** description */
53      protected String description;
54  
55      /** handlerName */
56      protected String handlerName;
57  
58      /** handlerParameter */
59      protected String handlerParameter;
60  
61      /** handlerScript */
62      protected String handlerScript;
63  
64      /** name */
65      protected String name;
66  
67      /** permissions */
68      protected String[] permissions;
69  
70      /** sortOrder */
71      protected Integer sortOrder;
72  
73      /** updatedBy */
74      protected String updatedBy;
75  
76      /** updatedTime */
77      protected Long updatedTime;
78  
79      /** virtualHosts */
80      protected String[] virtualHosts;
81  
82      // [Referrers] *comment only
83  
84      // ===================================================================================
85      //                                                                             DB Meta
86      //                                                                             =======
87      @Override
88      public DataConfigDbm asDBMeta() {
89          return DataConfigDbm.getInstance();
90      }
91  
92      @Override
93      public String asTableDbName() {
94          return "data_config";
95      }
96  
97      // ===================================================================================
98      //                                                                              Source
99      //                                                                              ======
100     @Override
101     public Map<String, Object> toSource() {
102         Map<String, Object> sourceMap = new HashMap<>();
103         if (available != null) {
104             addFieldToSource(sourceMap, "available", available);
105         }
106         if (boost != null) {
107             addFieldToSource(sourceMap, "boost", boost);
108         }
109         if (createdBy != null) {
110             addFieldToSource(sourceMap, "createdBy", createdBy);
111         }
112         if (createdTime != null) {
113             addFieldToSource(sourceMap, "createdTime", createdTime);
114         }
115         if (description != null) {
116             addFieldToSource(sourceMap, "description", description);
117         }
118         if (handlerName != null) {
119             addFieldToSource(sourceMap, "handlerName", handlerName);
120         }
121         if (handlerParameter != null) {
122             addFieldToSource(sourceMap, "handlerParameter", handlerParameter);
123         }
124         if (handlerScript != null) {
125             addFieldToSource(sourceMap, "handlerScript", handlerScript);
126         }
127         if (name != null) {
128             addFieldToSource(sourceMap, "name", name);
129         }
130         if (permissions != null) {
131             addFieldToSource(sourceMap, "permissions", permissions);
132         }
133         if (sortOrder != null) {
134             addFieldToSource(sourceMap, "sortOrder", sortOrder);
135         }
136         if (updatedBy != null) {
137             addFieldToSource(sourceMap, "updatedBy", updatedBy);
138         }
139         if (updatedTime != null) {
140             addFieldToSource(sourceMap, "updatedTime", updatedTime);
141         }
142         if (virtualHosts != null) {
143             addFieldToSource(sourceMap, "virtualHosts", virtualHosts);
144         }
145         return sourceMap;
146     }
147 
148     protected void addFieldToSource(Map<String, Object> sourceMap, String field, Object value) {
149         sourceMap.put(field, value);
150     }
151 
152     // ===================================================================================
153     //                                                                      Basic Override
154     //                                                                      ==============
155     @Override
156     protected String doBuildColumnString(String dm) {
157         StringBuilder sb = new StringBuilder();
158         sb.append(dm).append(available);
159         sb.append(dm).append(boost);
160         sb.append(dm).append(createdBy);
161         sb.append(dm).append(createdTime);
162         sb.append(dm).append(description);
163         sb.append(dm).append(handlerName);
164         sb.append(dm).append(handlerParameter);
165         sb.append(dm).append(handlerScript);
166         sb.append(dm).append(name);
167         sb.append(dm).append(permissions);
168         sb.append(dm).append(sortOrder);
169         sb.append(dm).append(updatedBy);
170         sb.append(dm).append(updatedTime);
171         sb.append(dm).append(virtualHosts);
172         if (sb.length() > dm.length()) {
173             sb.delete(0, dm.length());
174         }
175         sb.insert(0, "{").append("}");
176         return sb.toString();
177     }
178 
179     // ===================================================================================
180     //                                                                            Accessor
181     //                                                                            ========
182     public Boolean getAvailable() {
183         checkSpecifiedProperty("available");
184         return available;
185     }
186 
187     public void setAvailable(Boolean value) {
188         registerModifiedProperty("available");
189         this.available = value;
190     }
191 
192     public Float getBoost() {
193         checkSpecifiedProperty("boost");
194         return boost;
195     }
196 
197     public void setBoost(Float value) {
198         registerModifiedProperty("boost");
199         this.boost = value;
200     }
201 
202     public String getCreatedBy() {
203         checkSpecifiedProperty("createdBy");
204         return convertEmptyToNull(createdBy);
205     }
206 
207     public void setCreatedBy(String value) {
208         registerModifiedProperty("createdBy");
209         this.createdBy = value;
210     }
211 
212     public Long getCreatedTime() {
213         checkSpecifiedProperty("createdTime");
214         return createdTime;
215     }
216 
217     public void setCreatedTime(Long value) {
218         registerModifiedProperty("createdTime");
219         this.createdTime = value;
220     }
221 
222     public String getDescription() {
223         checkSpecifiedProperty("description");
224         return convertEmptyToNull(description);
225     }
226 
227     public void setDescription(String value) {
228         registerModifiedProperty("description");
229         this.description = value;
230     }
231 
232     public String getHandlerName() {
233         checkSpecifiedProperty("handlerName");
234         return convertEmptyToNull(handlerName);
235     }
236 
237     public void setHandlerName(String value) {
238         registerModifiedProperty("handlerName");
239         this.handlerName = value;
240     }
241 
242     public String getHandlerParameter() {
243         checkSpecifiedProperty("handlerParameter");
244         return convertEmptyToNull(handlerParameter);
245     }
246 
247     public void setHandlerParameter(String value) {
248         registerModifiedProperty("handlerParameter");
249         this.handlerParameter = value;
250     }
251 
252     public String getHandlerScript() {
253         checkSpecifiedProperty("handlerScript");
254         return convertEmptyToNull(handlerScript);
255     }
256 
257     public void setHandlerScript(String value) {
258         registerModifiedProperty("handlerScript");
259         this.handlerScript = value;
260     }
261 
262     public String getName() {
263         checkSpecifiedProperty("name");
264         return convertEmptyToNull(name);
265     }
266 
267     public void setName(String value) {
268         registerModifiedProperty("name");
269         this.name = value;
270     }
271 
272     public String[] getPermissions() {
273         checkSpecifiedProperty("permissions");
274         return permissions;
275     }
276 
277     public void setPermissions(String[] value) {
278         registerModifiedProperty("permissions");
279         this.permissions = value;
280     }
281 
282     public Integer getSortOrder() {
283         checkSpecifiedProperty("sortOrder");
284         return sortOrder;
285     }
286 
287     public void setSortOrder(Integer value) {
288         registerModifiedProperty("sortOrder");
289         this.sortOrder = value;
290     }
291 
292     public String getUpdatedBy() {
293         checkSpecifiedProperty("updatedBy");
294         return convertEmptyToNull(updatedBy);
295     }
296 
297     public void setUpdatedBy(String value) {
298         registerModifiedProperty("updatedBy");
299         this.updatedBy = value;
300     }
301 
302     public Long getUpdatedTime() {
303         checkSpecifiedProperty("updatedTime");
304         return updatedTime;
305     }
306 
307     public void setUpdatedTime(Long value) {
308         registerModifiedProperty("updatedTime");
309         this.updatedTime = value;
310     }
311 
312     public String[] getVirtualHosts() {
313         checkSpecifiedProperty("virtualHosts");
314         return virtualHosts;
315     }
316 
317     public void setVirtualHosts(String[] value) {
318         registerModifiedProperty("virtualHosts");
319         this.virtualHosts = value;
320     }
321 }