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