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.CrawlingInfoParamDbm;
24
25 /**
26 * ${table.comment}
27 * @author ESFlute (using FreeGen)
28 */
29 public class BsCrawlingInfoParam 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 /** crawlingInfoId */
41 protected String crawlingInfoId;
42
43 /** createdTime */
44 protected Long createdTime;
45
46 /** key */
47 protected String key;
48
49 /** value */
50 protected String value;
51
52 // [Referrers] *comment only
53
54 // ===================================================================================
55 // DB Meta
56 // =======
57 @Override
58 public CrawlingInfoParamDbm asDBMeta() {
59 return CrawlingInfoParamDbm.getInstance();
60 }
61
62 @Override
63 public String asTableDbName() {
64 return "crawling_info_param";
65 }
66
67 // ===================================================================================
68 // Source
69 // ======
70 @Override
71 public Map<String, Object> toSource() {
72 Map<String, Object> sourceMap = new HashMap<>();
73 if (crawlingInfoId != null) {
74 addFieldToSource(sourceMap, "crawlingInfoId", crawlingInfoId);
75 }
76 if (createdTime != null) {
77 addFieldToSource(sourceMap, "createdTime", createdTime);
78 }
79 if (key != null) {
80 addFieldToSource(sourceMap, "key", key);
81 }
82 if (value != null) {
83 addFieldToSource(sourceMap, "value", value);
84 }
85 return sourceMap;
86 }
87
88 protected void addFieldToSource(Map<String, Object> sourceMap, String field, Object value) {
89 sourceMap.put(field, value);
90 }
91
92 // ===================================================================================
93 // Basic Override
94 // ==============
95 @Override
96 protected String doBuildColumnString(String dm) {
97 StringBuilder sb = new StringBuilder();
98 sb.append(dm).append(crawlingInfoId);
99 sb.append(dm).append(createdTime);
100 sb.append(dm).append(key);
101 sb.append(dm).append(value);
102 if (sb.length() > dm.length()) {
103 sb.delete(0, dm.length());
104 }
105 sb.insert(0, "{").append("}");
106 return sb.toString();
107 }
108
109 // ===================================================================================
110 // Accessor
111 // ========
112 public String getCrawlingInfoId() {
113 checkSpecifiedProperty("crawlingInfoId");
114 return convertEmptyToNull(crawlingInfoId);
115 }
116
117 public void setCrawlingInfoId(String value) {
118 registerModifiedProperty("crawlingInfoId");
119 this.crawlingInfoId = value;
120 }
121
122 public Long getCreatedTime() {
123 checkSpecifiedProperty("createdTime");
124 return createdTime;
125 }
126
127 public void setCreatedTime(Long value) {
128 registerModifiedProperty("createdTime");
129 this.createdTime = value;
130 }
131
132 public String getKey() {
133 checkSpecifiedProperty("key");
134 return convertEmptyToNull(key);
135 }
136
137 public void setKey(String value) {
138 registerModifiedProperty("key");
139 this.key = value;
140 }
141
142 public String getValue() {
143 checkSpecifiedProperty("value");
144 return convertEmptyToNull(value);
145 }
146
147 public void setValue(String value) {
148 registerModifiedProperty("value");
149 this.value = value;
150 }
151 }