use of org.opensmartgridplatform.domain.core.valueobjects.Address in project open-smart-grid-platform by OSGP.
the class WsInstallationDeviceToSsldConverter method convert.
@Override
public Ssld convert(final Device source, final Type<? extends Ssld> destinationType, final MappingContext mappingContext) {
LOGGER.debug("Converting WS Installation Device into SSLD [{}]", source.getDeviceIdentification());
final String deviceIdentification = source.getDeviceIdentification();
final String alias = source.getAlias();
final Address containerAddress = this.mapperFacade.map(source.getContainerAddress(), Address.class);
final GpsCoordinates gpsCoordinates = new GpsCoordinates(source.getGpsLatitude(), source.getGpsLongitude());
final Ssld ssld = new Ssld(deviceIdentification, alias, containerAddress, gpsCoordinates, null);
ssld.setPublicKeyPresent(source.isPublicKeyPresent());
return ssld;
}
Aggregations