public NetworkWithUsersAndDevicesVO(NetworkVO vo) { setId(vo.getId()); setName(vo.getName()); setDescription(vo.getDescription()); setEntityVersion(vo.getEntityVersion()); }
public DeviceTypeWithUsersAndDevicesVO(DeviceTypeVO vo) { setId(vo.getId()); setName(vo.getName()); setDescription(vo.getDescription()); setEntityVersion(vo.getEntityVersion()); }
public PluginVO convertTo() { PluginVO pluginVO = new PluginVO(); pluginVO.setName(name); pluginVO.setDescription(description); pluginVO.setStatus(ACTIVE); pluginVO.setParameters(parameters); return pluginVO; } }
public static UserWithNetworkVO fromUserVO(UserVO dc) { UserWithNetworkVO vo = null; if (dc != null) { vo = new UserWithNetworkVO(); vo.setData(dc.getData()); vo.setId(dc.getId()); vo.setData(dc.getData()); vo.setLastLogin(dc.getLastLogin()); vo.setLogin(dc.getLogin()); vo.setLoginAttempts(dc.getLoginAttempts()); vo.setNetworks(new HashSet<>()); vo.setPasswordHash(dc.getPasswordHash()); vo.setPasswordSalt(dc.getPasswordSalt()); vo.setRole(dc.getRole()); vo.setStatus(dc.getStatus()); vo.setIntroReviewed(dc.getIntroReviewed()); vo.setAllDeviceTypesAvailable(dc.getAllDeviceTypesAvailable()); } return vo; }
public static UserWithDeviceTypeVO fromUserVO(UserVO dc) { UserWithDeviceTypeVO vo = null; if (dc != null) { vo = new UserWithDeviceTypeVO(); vo.setData(dc.getData()); vo.setId(dc.getId()); vo.setData(dc.getData()); vo.setLastLogin(dc.getLastLogin()); vo.setLogin(dc.getLogin()); vo.setLoginAttempts(dc.getLoginAttempts()); vo.setDeviceTypes(new HashSet<>()); vo.setPasswordHash(dc.getPasswordHash()); vo.setPasswordSalt(dc.getPasswordSalt()); vo.setRole(dc.getRole()); vo.setStatus(dc.getStatus()); vo.setIntroReviewed(dc.getIntroReviewed()); vo.setAllDeviceTypesAvailable(dc.getAllDeviceTypesAvailable()); } return vo; }
public static DeviceVO convertToVo(Device dc) { DeviceVO vo = null; if (dc != null) { vo = new DeviceVO(); vo.setId(dc.getId()); vo.setDeviceId(dc.getDeviceId()); vo.setName(dc.getName()); vo.setData(dc.getData()); vo.setBlocked(dc.getBlocked()); NetworkVO networkVO = Network.convertNetwork(dc.getNetwork()); vo.setNetworkId(networkVO.getId()); DeviceTypeVO deviceTypeVO = DeviceType.convertDeviceType(dc.getDeviceType()); vo.setDeviceTypeId(deviceTypeVO.getId()); } return vo; }
public DeviceVO convertTo(String deviceId) { DeviceVO device = new DeviceVO(); if (deviceId != null){ device.setDeviceId(deviceId); } if (this.data != null){ device.setData(this.data); } if (this.name != null){ device.setName(this.name); } if (this.networkId != null){ device.setNetworkId(this.networkId); } if (this.deviceTypeId != null){ device.setDeviceTypeId(this.deviceTypeId); } if (this.blocked != null){ device.setBlocked(this.blocked); } return device; } }
public static NetworkVO convertNetwork(Network network) { if (network != null) { NetworkVO vo = new NetworkVO(); vo.setId(network.getId()); vo.setName(network.getName()); vo.setDescription(network.getDescription()); vo.setEntityVersion(network.getEntityVersion()); return vo; } return null; }
public NetworkVO convertTo() { NetworkVO networkVO = new NetworkVO(); networkVO.setName(name); networkVO.setDescription(description); return networkVO; } }
@Transactional public DeviceTypeVO createOrUpdateDeviceTypeByUser(UserVO user) { DeviceTypeVO deviceTypeVO = new DeviceTypeVO(); deviceTypeVO.setName(user.getLogin()); deviceTypeVO.setDescription(String.format("User %s default device type", user.getLogin())); return createOrUpdateDeviceTypeByUser(Optional.ofNullable(deviceTypeVO), user); }
public static Network convert(NetworkVO vo) { if (vo != null) { Network network = new Network(); network.setId(vo.getId()); network.setName(vo.getName()); network.setDescription(vo.getDescription()); network.setEntityVersion(vo.getEntityVersion()); return network; } return null; } }
public static DeviceTypeVO convertDeviceType(DeviceType deviceType) { if (deviceType != null) { DeviceTypeVO vo = new DeviceTypeVO(); vo.setId(deviceType.getId()); vo.setName(deviceType.getName()); vo.setDescription(deviceType.getDescription()); vo.setEntityVersion(deviceType.getEntityVersion()); return vo; } return null; }
public static DeviceType convert(DeviceTypeVO vo) { if (vo != null) { DeviceType deviceType = new DeviceType(); deviceType.setId(vo.getId()); deviceType.setName(vo.getName()); deviceType.setDescription(vo.getDescription()); deviceType.setEntityVersion(vo.getEntityVersion()); return deviceType; } return null; } }
public DeviceTypeVO convertTo() { DeviceTypeVO deviceTypeVO = new DeviceTypeVO(); deviceTypeVO.setName(name); deviceTypeVO.setDescription(description); return deviceTypeVO; } }
public static ConfigurationVO convert(Configuration configuration) { if (configuration != null) { ConfigurationVO vo = new ConfigurationVO(); vo.setName(configuration.getName()); vo.setValue(configuration.getValue()); vo.setEntityVersion(configuration.getEntityVersion()); return vo; } else { return null; } }
@Override @ApiModelProperty(hidden = true) public String getRefreshToken() { return super.getRefreshToken(); } }
@Override @ApiModelProperty(hidden = true) public String getAccessToken() { return super.getAccessToken(); } }
public static Configuration convert(ConfigurationVO vo) { if (vo != null) { Configuration result = new Configuration(); result.setName(vo.getName()); result.setValue(vo.getValue()); result.setEntityVersion(vo.getEntityVersion()); return result; } else { return null; } }