Search in sources :

Example 1 with SendDestinationAndMethodDto

use of org.opensmartgridplatform.dto.valueobjects.smartmetering.SendDestinationAndMethodDto in project open-smart-grid-platform by OSGP.

the class DlmsHelper method readSendDestinationAndMethod.

public SendDestinationAndMethodDto readSendDestinationAndMethod(final DataObject resultData, final String description) throws ProtocolAdapterException {
    final List<DataObject> sendDestinationAndMethodElements = this.readList(resultData, description);
    if (sendDestinationAndMethodElements == null) {
        return null;
    }
    final TransportServiceTypeDto transportService = this.readTransportServiceType(sendDestinationAndMethodElements.get(0), "Transport Service from " + description);
    final String destination = this.readString(sendDestinationAndMethodElements.get(1), "Destination from " + description);
    final MessageTypeDto message = this.readMessageType(sendDestinationAndMethodElements.get(2), "Message from " + description);
    return new SendDestinationAndMethodDto(transportService, destination, message);
}
Also used : SendDestinationAndMethodDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.SendDestinationAndMethodDto) DataObject(org.openmuc.jdlms.datatypes.DataObject) TransportServiceTypeDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.TransportServiceTypeDto) BitString(org.openmuc.jdlms.datatypes.BitString) MessageTypeDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.MessageTypeDto)

Example 2 with SendDestinationAndMethodDto

use of org.opensmartgridplatform.dto.valueobjects.smartmetering.SendDestinationAndMethodDto in project open-smart-grid-platform by OSGP.

the class PushSetupSmsMappingTest method checkSendDestinationAndMethodMapping.

// method to test SendDestinationAndMethod mapping
private void checkSendDestinationAndMethodMapping(final PushSetupSms pushSetupSms, final PushSetupSmsDto pushSetupSmsDto) {
    final SendDestinationAndMethod sendDestinationAndMethod = pushSetupSms.getSendDestinationAndMethod();
    final SendDestinationAndMethodDto sendDestinationAndMethodDto = pushSetupSmsDto.getSendDestinationAndMethod();
    // make sure neither is null
    assertThat(sendDestinationAndMethod).isNotNull();
    assertThat(sendDestinationAndMethodDto).isNotNull();
    // make sure all instance variables are equal
    assertThat(sendDestinationAndMethodDto.getTransportService().name()).isEqualTo(sendDestinationAndMethod.getTransportService().name());
    assertThat(sendDestinationAndMethodDto.getMessage().name()).isEqualTo(sendDestinationAndMethod.getMessage().name());
    assertThat(sendDestinationAndMethodDto.getDestination()).isEqualTo(sendDestinationAndMethod.getDestination());
}
Also used : SendDestinationAndMethod(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.SendDestinationAndMethod) SendDestinationAndMethodDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.SendDestinationAndMethodDto)

Example 3 with SendDestinationAndMethodDto

use of org.opensmartgridplatform.dto.valueobjects.smartmetering.SendDestinationAndMethodDto in project open-smart-grid-platform by OSGP.

the class PushSetupAlarmMappingTest method checkSendDestinationAndMethodMapping.

// method to test SendDestinationAndMethod mapping
private void checkSendDestinationAndMethodMapping(final PushSetupAlarm pushSetupAlarm, final PushSetupAlarmDto pushSetupAlarmDto) {
    final SendDestinationAndMethod sendDestinationAndMethod = pushSetupAlarm.getSendDestinationAndMethod();
    final SendDestinationAndMethodDto sendDestinationAndMethodDto = pushSetupAlarmDto.getSendDestinationAndMethod();
    // make sure neither is null
    assertThat(sendDestinationAndMethod).isNotNull();
    assertThat(sendDestinationAndMethodDto).isNotNull();
    // make sure all instance variables are equal
    assertThat(sendDestinationAndMethodDto.getTransportService().name()).isEqualTo(sendDestinationAndMethod.getTransportService().name());
    assertThat(sendDestinationAndMethodDto.getMessage().name()).isEqualTo(sendDestinationAndMethod.getMessage().name());
    assertThat(sendDestinationAndMethodDto.getDestination()).isEqualTo(sendDestinationAndMethod.getDestination());
}
Also used : SendDestinationAndMethod(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.SendDestinationAndMethod) SendDestinationAndMethodDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.SendDestinationAndMethodDto)

Aggregations

SendDestinationAndMethodDto (org.opensmartgridplatform.dto.valueobjects.smartmetering.SendDestinationAndMethodDto)3 SendDestinationAndMethod (org.opensmartgridplatform.domain.core.valueobjects.smartmetering.SendDestinationAndMethod)2 BitString (org.openmuc.jdlms.datatypes.BitString)1 DataObject (org.openmuc.jdlms.datatypes.DataObject)1 MessageTypeDto (org.opensmartgridplatform.dto.valueobjects.smartmetering.MessageTypeDto)1 TransportServiceTypeDto (org.opensmartgridplatform.dto.valueobjects.smartmetering.TransportServiceTypeDto)1