use of org.thingsboard.server.common.data.id.TenantId in project thingsboard by thingsboard.
the class CustomerEntity method toData.
@Override
public Customer toData() {
Customer customer = new Customer(new CustomerId(id));
customer.setCreatedTime(UUIDs.unixTimestamp(id));
customer.setTenantId(new TenantId(tenantId));
customer.setTitle(title);
customer.setCountry(country);
customer.setState(state);
customer.setCity(city);
customer.setAddress(address);
customer.setAddress2(address2);
customer.setZip(zip);
customer.setPhone(phone);
customer.setEmail(email);
customer.setAdditionalInfo(additionalInfo);
return customer;
}
use of org.thingsboard.server.common.data.id.TenantId in project thingsboard by thingsboard.
the class DeviceEntity method toData.
@Override
public Device toData() {
Device device = new Device(new DeviceId(getId()));
device.setCreatedTime(UUIDs.unixTimestamp(getId()));
if (tenantId != null) {
device.setTenantId(new TenantId(toUUID(tenantId)));
}
if (customerId != null) {
device.setCustomerId(new CustomerId(toUUID(customerId)));
}
device.setName(name);
device.setType(type);
device.setAdditionalInfo(additionalInfo);
return device;
}
use of org.thingsboard.server.common.data.id.TenantId in project thingsboard by thingsboard.
the class EventEntity method toData.
@Override
public Event toData() {
Event event = new Event(new EventId(getId()));
event.setCreatedTime(UUIDs.unixTimestamp(getId()));
event.setTenantId(new TenantId(toUUID(tenantId)));
event.setEntityId(EntityIdFactory.getByTypeAndUuid(entityType, toUUID(entityId)));
event.setBody(body);
event.setType(eventType);
event.setUid(eventUid);
return event;
}
use of org.thingsboard.server.common.data.id.TenantId in project thingsboard by thingsboard.
the class RuleMetaDataEntity method toData.
@Override
public RuleMetaData toData() {
RuleMetaData rule = new RuleMetaData(new RuleId(getId()));
rule.setTenantId(new TenantId(toUUID(tenantId)));
rule.setName(name);
rule.setState(state);
rule.setWeight(weight);
rule.setCreatedTime(UUIDs.unixTimestamp(getId()));
rule.setPluginToken(pluginToken);
rule.setFilters(filters);
rule.setProcessor(processor);
rule.setAction(action);
rule.setAdditionalInfo(additionalInfo);
return rule;
}
use of org.thingsboard.server.common.data.id.TenantId in project thingsboard by thingsboard.
the class TenantEntity method toData.
@Override
public Tenant toData() {
Tenant tenant = new Tenant(new TenantId(getId()));
tenant.setCreatedTime(UUIDs.unixTimestamp(getId()));
tenant.setTitle(title);
tenant.setRegion(region);
tenant.setCountry(country);
tenant.setState(state);
tenant.setCity(city);
tenant.setAddress(address);
tenant.setAddress2(address2);
tenant.setZip(zip);
tenant.setPhone(phone);
tenant.setEmail(email);
tenant.setAdditionalInfo(additionalInfo);
return tenant;
}
Aggregations