1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.codelibs.fess.opensearch.config.exentity;
17
18 import java.util.Locale;
19
20 import org.codelibs.fess.opensearch.config.bsentity.BsLabelType;
21 import org.codelibs.fess.util.ComponentUtil;
22
23
24
25
26 public class LabelType extends BsLabelType {
27
28 private static final long serialVersionUID = 1L;
29 private Locale locale;
30
31 public String getId() {
32 return asDocMeta().id();
33 }
34
35 public void setId(final String id) {
36 asDocMeta().id(id);
37 }
38
39 public Long getVersionNo() {
40 return asDocMeta().version();
41 }
42
43 public void setVersionNo(final Long version) {
44 asDocMeta().version(version);
45 }
46
47 public Locale getLocale() {
48 if (locale == null) {
49 if (getValue() == null) {
50 return Locale.ROOT;
51 }
52 locale = ComponentUtil.getFessConfig().getQueryLocaleFromName(getValue());
53 }
54 return locale;
55 }
56
57 @Override
58 public String toString() {
59 return "LabelType [createdBy=" + createdBy + ", createdTime=" + createdTime + ", excludedPaths=" + excludedPaths
60 + ", includedPaths=" + includedPaths + ", name=" + name + ", sortOrder=" + sortOrder + ", updatedBy=" + updatedBy
61 + ", updatedTime=" + updatedTime + ", value=" + value + ", docMeta=" + docMeta + "]";
62 }
63 }