use of org.opensmartgridplatform.domain.core.valueobjects.LightType in project open-smart-grid-platform by OSGP.
the class ConfigurationConverter method convertTo.
@Override
public Configuration convertTo(final org.opensmartgridplatform.dto.valueobjects.ConfigurationDto source, final Type<Configuration> destinationType, final MappingContext context) {
final LightType lightType = this.mapperFacade.map(source.getLightType(), LightType.class);
final DaliConfiguration daliConfiguration = this.mapperFacade.map(source.getDaliConfiguration(), DaliConfiguration.class);
final RelayConfiguration relayConfiguration = this.mapperFacade.map(source.getRelayConfiguration(), RelayConfiguration.class);
final LinkType preferredLinkType = this.mapperFacade.map(source.getPreferredLinkType(), LinkType.class);
final Configuration.Builder builder = new Configuration.Builder().withLightType(lightType).withDaliConfiguration(daliConfiguration).withRelayConfiguration(relayConfiguration).withPreferredLinkType(preferredLinkType).withTimeSyncFrequency(source.getTimeSyncFrequency()).withDhcpEnabled(source.isDhcpEnabled()).withTlsEnabled(source.isTlsEnabled()).withTlsPortNumber(source.getTlsPortNumber()).withCommonNameString(source.getCommonNameString()).withCommunicationTimeout(source.getCommunicationTimeout()).withCommunicationNumberOfRetries(source.getCommunicationNumberOfRetries()).withCommunicationPauseTimeBetweenConnectionTrials(source.getCommunicationPauseTimeBetweenConnectionTrials()).withOsgpIpAddress(source.getOsgpIpAddres()).withOsgpPortNumber(source.getOsgpPortNumber()).withNtpHost(source.getNtpHost()).withNtpEnabled(source.getNtpEnabled()).withNtpSyncInterval(source.getNtpSyncInterval()).withTestButtonEnabled(source.isTestButtonEnabled()).withAutomaticSummerTimingEnabled(source.isAutomaticSummerTimingEnabled()).withAstroGateSunRiseOffset(source.getAstroGateSunRiseOffset()).withAstroGateSunSetOffset(source.getAstroGateSunSetOffset()).withSwitchingDelays(source.getSwitchingDelays()).withRelayRefreshing(source.isRelayRefreshing()).withSummerTimeDetails(source.getSummerTimeDetails()).withWinterTimeDetails(source.getWinterTimeDetails());
if (source.getRelayLinking() != null) {
builder.withRelayLinking(this.mapperFacade.mapAsList(source.getRelayLinking(), org.opensmartgridplatform.domain.core.valueobjects.RelayMatrix.class));
}
if (source.getDeviceFixedIp() != null) {
builder.withDeviceFixedIp(this.mapperFacade.map(source.getDeviceFixedIp(), DeviceFixedIp.class));
}
return builder.build();
}
Aggregations