Was created EntityView class
This commit is contained in:
parent
2b0ac1f1d0
commit
30e1c480ed
@ -19,5 +19,5 @@ package org.thingsboard.server.common.data;
|
||||
* @author Andrew Shvayka
|
||||
*/
|
||||
public enum EntityType {
|
||||
TENANT, CUSTOMER, USER, DASHBOARD, ASSET, DEVICE, ALARM, RULE_CHAIN, RULE_NODE;
|
||||
TENANT, CUSTOMER, USER, DASHBOARD, ASSET, DEVICE, ALARM, RULE_CHAIN, RULE_NODE, ENTITY_VIEW
|
||||
}
|
||||
|
||||
@ -0,0 +1,127 @@
|
||||
package org.thingsboard.server.common.data;
|
||||
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.thingsboard.server.common.data.id.CustomerId;
|
||||
import org.thingsboard.server.common.data.id.EntityId;
|
||||
import org.thingsboard.server.common.data.id.EntityViewId;
|
||||
import org.thingsboard.server.common.data.id.TenantId;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class EntityView extends SearchTextBasedWithAdditionalInfo<EntityViewId>
|
||||
implements HasName, HasTenantId, HasCustomerId {
|
||||
|
||||
private static final long serialVersionUID = 5582010124562018986L;
|
||||
|
||||
private EntityId entityId;
|
||||
private TenantId tenantId;
|
||||
private CustomerId customerId;
|
||||
private String name;
|
||||
private List<String> keys;
|
||||
private Long tsStart;
|
||||
private Long tsEnd;
|
||||
|
||||
public EntityView() {
|
||||
}
|
||||
|
||||
public EntityView(EntityViewId id) {
|
||||
super(id);
|
||||
}
|
||||
|
||||
public EntityView(EntityId entityId,
|
||||
TenantId tenantId,
|
||||
CustomerId customerId,
|
||||
String name,
|
||||
List<String> keys,
|
||||
Long tsStart,
|
||||
Long tsEnd) {
|
||||
|
||||
this.entityId = entityId;
|
||||
this.tenantId = tenantId;
|
||||
this.customerId = customerId;
|
||||
this.name = name;
|
||||
this.keys = keys;
|
||||
this.tsStart = tsStart;
|
||||
this.tsEnd = tsEnd;
|
||||
}
|
||||
|
||||
public EntityView(EntityView entityView) {
|
||||
super(entityView);
|
||||
}
|
||||
|
||||
public EntityId getEntityId() {
|
||||
return entityId;
|
||||
}
|
||||
|
||||
public void setEntityId(EntityId entityId) {
|
||||
this.entityId = entityId;
|
||||
}
|
||||
|
||||
public void setTenantId(TenantId tenantId) {
|
||||
this.tenantId = tenantId;
|
||||
}
|
||||
|
||||
public void setCustomerId(CustomerId customerId) {
|
||||
this.customerId = customerId;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public List<String> getKeys() {
|
||||
return keys;
|
||||
}
|
||||
|
||||
public void setKeys(List<String> keys) {
|
||||
this.keys = keys;
|
||||
}
|
||||
|
||||
public Long getTsStart() {
|
||||
return tsStart;
|
||||
}
|
||||
|
||||
public void setTsStart(Long tsStart) {
|
||||
this.tsStart = tsStart;
|
||||
}
|
||||
|
||||
public Long getTsEnd() {
|
||||
return tsEnd;
|
||||
}
|
||||
|
||||
public void setTsEnd(Long tsEnd) {
|
||||
this.tsEnd = tsEnd;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSearchText() {
|
||||
return getName() /*What the ...*/;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CustomerId getCustomerId() {
|
||||
return customerId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TenantId getTenantId() {
|
||||
return tenantId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "EntityView{entityId=" + entityId.getId() +
|
||||
", tenantId=" + tenantId +
|
||||
", customerId=" + customerId +
|
||||
", name='" + name + "\'" +
|
||||
", keys=" + String.join(",", keys) +
|
||||
", tsStart=" + tsStart +
|
||||
", tsEnd=" + tsEnd + "}";
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user