use of org.thingsboard.server.common.data.id.TenantId in project thingsboard by thingsboard.
the class WidgetTypeEntity method toData.
@Override
public WidgetType toData() {
WidgetType widgetType = new WidgetType(new WidgetTypeId(id));
widgetType.setCreatedTime(UUIDs.unixTimestamp(id));
if (tenantId != null) {
widgetType.setTenantId(new TenantId(tenantId));
}
widgetType.setBundleAlias(bundleAlias);
widgetType.setAlias(alias);
widgetType.setName(name);
widgetType.setDescriptor(descriptor);
return widgetType;
}
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(getId()));
customer.setCreatedTime(UUIDs.unixTimestamp(getId()));
customer.setTenantId(new TenantId(UUIDConverter.fromString(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 DashboardEntity method toData.
@Override
public Dashboard toData() {
Dashboard dashboard = new Dashboard(new DashboardId(id));
dashboard.setCreatedTime(UUIDs.unixTimestamp(id));
if (tenantId != null) {
dashboard.setTenantId(new TenantId(tenantId));
}
dashboard.setTitle(title);
if (!StringUtils.isEmpty(assignedCustomers)) {
try {
dashboard.setAssignedCustomers(objectMapper.readValue(assignedCustomers, assignedCustomersType));
} catch (IOException e) {
log.warn("Unable to parse assigned customers!", e);
}
}
dashboard.setConfiguration(configuration);
return dashboard;
}
use of org.thingsboard.server.common.data.id.TenantId in project thingsboard by thingsboard.
the class WidgetTypeEntity method toData.
@Override
public WidgetType toData() {
WidgetType widgetType = new WidgetType(new WidgetTypeId(getId()));
widgetType.setCreatedTime(UUIDs.unixTimestamp(getId()));
if (tenantId != null) {
widgetType.setTenantId(new TenantId(toUUID(tenantId)));
}
widgetType.setBundleAlias(bundleAlias);
widgetType.setAlias(alias);
widgetType.setName(name);
widgetType.setDescriptor(descriptor);
return widgetType;
}
use of org.thingsboard.server.common.data.id.TenantId in project thingsboard by thingsboard.
the class WidgetsBundleEntity method toData.
@Override
public WidgetsBundle toData() {
WidgetsBundle widgetsBundle = new WidgetsBundle(new WidgetsBundleId(UUIDConverter.fromString(id)));
widgetsBundle.setCreatedTime(UUIDs.unixTimestamp(UUIDConverter.fromString(id)));
if (tenantId != null) {
widgetsBundle.setTenantId(new TenantId(UUIDConverter.fromString(tenantId)));
}
widgetsBundle.setAlias(alias);
widgetsBundle.setTitle(title);
return widgetsBundle;
}
Aggregations