|
1
|
+package org.thingsboard.server.common.data;
|
|
2
|
+
|
|
3
|
+import lombok.EqualsAndHashCode;
|
|
4
|
+import org.thingsboard.server.common.data.id.CustomerId;
|
|
5
|
+import org.thingsboard.server.common.data.id.EntityId;
|
|
6
|
+import org.thingsboard.server.common.data.id.EntityViewId;
|
|
7
|
+import org.thingsboard.server.common.data.id.TenantId;
|
|
8
|
+
|
|
9
|
+import java.util.List;
|
|
10
|
+
|
|
11
|
+@EqualsAndHashCode(callSuper = true)
|
|
12
|
+public class EntityView extends SearchTextBasedWithAdditionalInfo<EntityViewId>
|
|
13
|
+ implements HasName, HasTenantId, HasCustomerId {
|
|
14
|
+
|
|
15
|
+ private static final long serialVersionUID = 5582010124562018986L;
|
|
16
|
+
|
|
17
|
+ private EntityId entityId;
|
|
18
|
+ private TenantId tenantId;
|
|
19
|
+ private CustomerId customerId;
|
|
20
|
+ private String name;
|
|
21
|
+ private List<String> keys;
|
|
22
|
+ private Long tsStart;
|
|
23
|
+ private Long tsEnd;
|
|
24
|
+
|
|
25
|
+ public EntityView() {
|
|
26
|
+ }
|
|
27
|
+
|
|
28
|
+ public EntityView(EntityViewId id) {
|
|
29
|
+ super(id);
|
|
30
|
+ }
|
|
31
|
+
|
|
32
|
+ public EntityView(EntityId entityId,
|
|
33
|
+ TenantId tenantId,
|
|
34
|
+ CustomerId customerId,
|
|
35
|
+ String name,
|
|
36
|
+ List<String> keys,
|
|
37
|
+ Long tsStart,
|
|
38
|
+ Long tsEnd) {
|
|
39
|
+
|
|
40
|
+ this.entityId = entityId;
|
|
41
|
+ this.tenantId = tenantId;
|
|
42
|
+ this.customerId = customerId;
|
|
43
|
+ this.name = name;
|
|
44
|
+ this.keys = keys;
|
|
45
|
+ this.tsStart = tsStart;
|
|
46
|
+ this.tsEnd = tsEnd;
|
|
47
|
+ }
|
|
48
|
+
|
|
49
|
+ public EntityView(EntityView entityView) {
|
|
50
|
+ super(entityView);
|
|
51
|
+ }
|
|
52
|
+
|
|
53
|
+ public EntityId getEntityId() {
|
|
54
|
+ return entityId;
|
|
55
|
+ }
|
|
56
|
+
|
|
57
|
+ public void setEntityId(EntityId entityId) {
|
|
58
|
+ this.entityId = entityId;
|
|
59
|
+ }
|
|
60
|
+
|
|
61
|
+ public void setTenantId(TenantId tenantId) {
|
|
62
|
+ this.tenantId = tenantId;
|
|
63
|
+ }
|
|
64
|
+
|
|
65
|
+ public void setCustomerId(CustomerId customerId) {
|
|
66
|
+ this.customerId = customerId;
|
|
67
|
+ }
|
|
68
|
+
|
|
69
|
+ public void setName(String name) {
|
|
70
|
+ this.name = name;
|
|
71
|
+ }
|
|
72
|
+
|
|
73
|
+ public List<String> getKeys() {
|
|
74
|
+ return keys;
|
|
75
|
+ }
|
|
76
|
+
|
|
77
|
+ public void setKeys(List<String> keys) {
|
|
78
|
+ this.keys = keys;
|
|
79
|
+ }
|
|
80
|
+
|
|
81
|
+ public Long getTsStart() {
|
|
82
|
+ return tsStart;
|
|
83
|
+ }
|
|
84
|
+
|
|
85
|
+ public void setTsStart(Long tsStart) {
|
|
86
|
+ this.tsStart = tsStart;
|
|
87
|
+ }
|
|
88
|
+
|
|
89
|
+ public Long getTsEnd() {
|
|
90
|
+ return tsEnd;
|
|
91
|
+ }
|
|
92
|
+
|
|
93
|
+ public void setTsEnd(Long tsEnd) {
|
|
94
|
+ this.tsEnd = tsEnd;
|
|
95
|
+ }
|
|
96
|
+
|
|
97
|
+ @Override
|
|
98
|
+ public String getSearchText() {
|
|
99
|
+ return getName() /*What the ...*/;
|
|
100
|
+ }
|
|
101
|
+
|
|
102
|
+ @Override
|
|
103
|
+ public CustomerId getCustomerId() {
|
|
104
|
+ return customerId;
|
|
105
|
+ }
|
|
106
|
+
|
|
107
|
+ @Override
|
|
108
|
+ public String getName() {
|
|
109
|
+ return name;
|
|
110
|
+ }
|
|
111
|
+
|
|
112
|
+ @Override
|
|
113
|
+ public TenantId getTenantId() {
|
|
114
|
+ return tenantId;
|
|
115
|
+ }
|
|
116
|
+
|
|
117
|
+ @Override
|
|
118
|
+ public String toString() {
|
|
119
|
+ return "EntityView{entityId=" + entityId.getId() +
|
|
120
|
+ ", tenantId=" + tenantId +
|
|
121
|
+ ", customerId=" + customerId +
|
|
122
|
+ ", name='" + name + "\'" +
|
|
123
|
+ ", keys=" + String.join(",", keys) +
|
|
124
|
+ ", tsStart=" + tsStart +
|
|
125
|
+ ", tsEnd=" + tsEnd + "}";
|
|
126
|
+ }
|
|
127
|
+} |
...
|
...
|
|