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.RequestHeaderDbm;
24  
25  /**
26   * ${table.comment}
27   * @author ESFlute (using FreeGen)
28   */
29  public class BsRequestHeader 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      /** createdBy */
41      protected String createdBy;
42  
43      /** createdTime */
44      protected Long createdTime;
45  
46      /** name */
47      protected String name;
48  
49      /** updatedBy */
50      protected String updatedBy;
51  
52      /** updatedTime */
53      protected Long updatedTime;
54  
55      /** value */
56      protected String value;
57  
58      /** webConfigId */
59      protected String webConfigId;
60  
61      // [Referrers] *comment only
62  
63      // ===================================================================================
64      //                                                                             DB Meta
65      //                                                                             =======
66      @Override
67      public RequestHeaderDbm asDBMeta() {
68          return RequestHeaderDbm.getInstance();
69      }
70  
71      @Override
72      public String asTableDbName() {
73          return "request_header";
74      }
75  
76      // ===================================================================================
77      //                                                                              Source
78      //                                                                              ======
79      @Override
80      public Map<String, Object> toSource() {
81          Map<String, Object> sourceMap = new HashMap<>();
82          if (createdBy != null) {
83              addFieldToSource(sourceMap, "createdBy", createdBy);
84          }
85          if (createdTime != null) {
86              addFieldToSource(sourceMap, "createdTime", createdTime);
87          }
88          if (name != null) {
89              addFieldToSource(sourceMap, "name", name);
90          }
91          if (updatedBy != null) {
92              addFieldToSource(sourceMap, "updatedBy", updatedBy);
93          }
94          if (updatedTime != null) {
95              addFieldToSource(sourceMap, "updatedTime", updatedTime);
96          }
97          if (value != null) {
98              addFieldToSource(sourceMap, "value", value);
99          }
100         if (webConfigId != null) {
101             addFieldToSource(sourceMap, "webConfigId", webConfigId);
102         }
103         return sourceMap;
104     }
105 
106     protected void addFieldToSource(Map<String, Object> sourceMap, String field, Object value) {
107         sourceMap.put(field, value);
108     }
109 
110     // ===================================================================================
111     //                                                                      Basic Override
112     //                                                                      ==============
113     @Override
114     protected String doBuildColumnString(String dm) {
115         StringBuilder sb = new StringBuilder();
116         sb.append(dm).append(createdBy);
117         sb.append(dm).append(createdTime);
118         sb.append(dm).append(name);
119         sb.append(dm).append(updatedBy);
120         sb.append(dm).append(updatedTime);
121         sb.append(dm).append(value);
122         sb.append(dm).append(webConfigId);
123         if (sb.length() > dm.length()) {
124             sb.delete(0, dm.length());
125         }
126         sb.insert(0, "{").append("}");
127         return sb.toString();
128     }
129 
130     // ===================================================================================
131     //                                                                            Accessor
132     //                                                                            ========
133     public String getCreatedBy() {
134         checkSpecifiedProperty("createdBy");
135         return convertEmptyToNull(createdBy);
136     }
137 
138     public void setCreatedBy(String value) {
139         registerModifiedProperty("createdBy");
140         this.createdBy = value;
141     }
142 
143     public Long getCreatedTime() {
144         checkSpecifiedProperty("createdTime");
145         return createdTime;
146     }
147 
148     public void setCreatedTime(Long value) {
149         registerModifiedProperty("createdTime");
150         this.createdTime = value;
151     }
152 
153     public String getName() {
154         checkSpecifiedProperty("name");
155         return convertEmptyToNull(name);
156     }
157 
158     public void setName(String value) {
159         registerModifiedProperty("name");
160         this.name = value;
161     }
162 
163     public String getUpdatedBy() {
164         checkSpecifiedProperty("updatedBy");
165         return convertEmptyToNull(updatedBy);
166     }
167 
168     public void setUpdatedBy(String value) {
169         registerModifiedProperty("updatedBy");
170         this.updatedBy = value;
171     }
172 
173     public Long getUpdatedTime() {
174         checkSpecifiedProperty("updatedTime");
175         return updatedTime;
176     }
177 
178     public void setUpdatedTime(Long value) {
179         registerModifiedProperty("updatedTime");
180         this.updatedTime = value;
181     }
182 
183     public String getValue() {
184         checkSpecifiedProperty("value");
185         return convertEmptyToNull(value);
186     }
187 
188     public void setValue(String value) {
189         registerModifiedProperty("value");
190         this.value = value;
191     }
192 
193     public String getWebConfigId() {
194         checkSpecifiedProperty("webConfigId");
195         return convertEmptyToNull(webConfigId);
196     }
197 
198     public void setWebConfigId(String value) {
199         registerModifiedProperty("webConfigId");
200         this.webConfigId = value;
201     }
202 }