public CassandraEndpointNotification(EndpointNotificationDto dto) {
   this.endpointKeyHash = ByteBuffer.wrap(dto.getEndpointKeyHash());
   NotificationDto notificationDto = dto.getNotificationDto();
   if (notificationDto != null) {
     this.seqNum = notificationDto.getSecNum();
     this.type = notificationDto.getType();
     this.applicationId = notificationDto.getApplicationId();
     this.schemaId = notificationDto.getSchemaId();
     this.nfVersion = notificationDto.getNfVersion();
     this.lastModifyTime = notificationDto.getLastTimeModify();
     this.body = getByteBuffer(notificationDto.getBody());
     this.expiredAt = notificationDto.getExpiredAt();
     this.topicId = notificationDto.getTopicId();
   }
   this.id = dto.getId() != null ? dto.getId() : generateId();
 }
 @Override
 public EndpointNotificationDto toDto() {
   EndpointNotificationDto dto = new EndpointNotificationDto();
   dto.setId(id != null ? id : generateId());
   dto.setEndpointKeyHash(endpointKeyHash != null ? endpointKeyHash.array() : null);
   NotificationDto notificationDto = new NotificationDto();
   notificationDto.setSecNum(seqNum);
   notificationDto.setType(type);
   notificationDto.setApplicationId(applicationId);
   notificationDto.setSchemaId(schemaId);
   notificationDto.setNfVersion(nfVersion);
   notificationDto.setLastTimeModify(lastModifyTime);
   notificationDto.setBody(getBytes(body));
   notificationDto.setExpiredAt(expiredAt);
   notificationDto.setTopicId(topicId);
   dto.setNotificationDto(notificationDto);
   return dto;
 }