View Javadoc
1   /*
2    * Copyright 2012-2021 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.es.config.bsentity;
17  
18  import java.time.LocalDateTime;
19  import java.util.HashMap;
20  import java.util.Map;
21  
22  import org.codelibs.fess.es.config.allcommon.EsAbstractEntity;
23  import org.codelibs.fess.es.config.bsentity.dbmeta.ElevateWordDbm;
24  
25  /**
26   * ${table.comment}
27   * @author ESFlute (using FreeGen)
28   */
29  public class BsElevateWord 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      /** boost */
41      protected Float boost;
42  
43      /** createdBy */
44      protected String createdBy;
45  
46      /** createdTime */
47      protected Long createdTime;
48  
49      /** permissions */
50      protected String[] permissions;
51  
52      /** reading */
53      protected String reading;
54  
55      /** suggestWord */
56      protected String suggestWord;
57  
58      /** updatedBy */
59      protected String updatedBy;
60  
61      /** updatedTime */
62      protected Long updatedTime;
63  
64      // [Referrers] *comment only
65  
66      // ===================================================================================
67      //                                                                             DB Meta
68      //                                                                             =======
69      @Override
70      public ElevateWordDbm asDBMeta() {
71          return ElevateWordDbm.getInstance();
72      }
73  
74      @Override
75      public String asTableDbName() {
76          return "elevate_word";
77      }
78  
79      // ===================================================================================
80      //                                                                              Source
81      //                                                                              ======
82      @Override
83      public Map<String, Object> toSource() {
84          Map<String, Object> sourceMap = new HashMap<>();
85          if (boost != null) {
86              addFieldToSource(sourceMap, "boost", boost);
87          }
88          if (createdBy != null) {
89              addFieldToSource(sourceMap, "createdBy", createdBy);
90          }
91          if (createdTime != null) {
92              addFieldToSource(sourceMap, "createdTime", createdTime);
93          }
94          if (permissions != null) {
95              addFieldToSource(sourceMap, "permissions", permissions);
96          }
97          if (reading != null) {
98              addFieldToSource(sourceMap, "reading", reading);
99          }
100         if (suggestWord != null) {
101             addFieldToSource(sourceMap, "suggestWord", suggestWord);
102         }
103         if (updatedBy != null) {
104             addFieldToSource(sourceMap, "updatedBy", updatedBy);
105         }
106         if (updatedTime != null) {
107             addFieldToSource(sourceMap, "updatedTime", updatedTime);
108         }
109         return sourceMap;
110     }
111 
112     protected void addFieldToSource(Map<String, Object> sourceMap, String field, Object value) {
113         sourceMap.put(field, value);
114     }
115 
116     // ===================================================================================
117     //                                                                      Basic Override
118     //                                                                      ==============
119     @Override
120     protected String doBuildColumnString(String dm) {
121         StringBuilder sb = new StringBuilder();
122         sb.append(dm).append(boost);
123         sb.append(dm).append(createdBy);
124         sb.append(dm).append(createdTime);
125         sb.append(dm).append(permissions);
126         sb.append(dm).append(reading);
127         sb.append(dm).append(suggestWord);
128         sb.append(dm).append(updatedBy);
129         sb.append(dm).append(updatedTime);
130         if (sb.length() > dm.length()) {
131             sb.delete(0, dm.length());
132         }
133         sb.insert(0, "{").append("}");
134         return sb.toString();
135     }
136 
137     // ===================================================================================
138     //                                                                            Accessor
139     //                                                                            ========
140     public Float getBoost() {
141         checkSpecifiedProperty("boost");
142         return boost;
143     }
144 
145     public void setBoost(Float value) {
146         registerModifiedProperty("boost");
147         this.boost = value;
148     }
149 
150     public String getCreatedBy() {
151         checkSpecifiedProperty("createdBy");
152         return convertEmptyToNull(createdBy);
153     }
154 
155     public void setCreatedBy(String value) {
156         registerModifiedProperty("createdBy");
157         this.createdBy = value;
158     }
159 
160     public Long getCreatedTime() {
161         checkSpecifiedProperty("createdTime");
162         return createdTime;
163     }
164 
165     public void setCreatedTime(Long value) {
166         registerModifiedProperty("createdTime");
167         this.createdTime = value;
168     }
169 
170     public String[] getPermissions() {
171         checkSpecifiedProperty("permissions");
172         return permissions;
173     }
174 
175     public void setPermissions(String[] value) {
176         registerModifiedProperty("permissions");
177         this.permissions = value;
178     }
179 
180     public String getReading() {
181         checkSpecifiedProperty("reading");
182         return convertEmptyToNull(reading);
183     }
184 
185     public void setReading(String value) {
186         registerModifiedProperty("reading");
187         this.reading = value;
188     }
189 
190     public String getSuggestWord() {
191         checkSpecifiedProperty("suggestWord");
192         return convertEmptyToNull(suggestWord);
193     }
194 
195     public void setSuggestWord(String value) {
196         registerModifiedProperty("suggestWord");
197         this.suggestWord = value;
198     }
199 
200     public String getUpdatedBy() {
201         checkSpecifiedProperty("updatedBy");
202         return convertEmptyToNull(updatedBy);
203     }
204 
205     public void setUpdatedBy(String value) {
206         registerModifiedProperty("updatedBy");
207         this.updatedBy = value;
208     }
209 
210     public Long getUpdatedTime() {
211         checkSpecifiedProperty("updatedTime");
212         return updatedTime;
213     }
214 
215     public void setUpdatedTime(Long value) {
216         registerModifiedProperty("updatedTime");
217         this.updatedTime = value;
218     }
219 }