/** * Get value of field <code>id</code>, if it is blank than generate this field by method * <code>generateId()</code> and return. * * @return id */ public String getStringId() { if (isBlank(id)) { generateId(); } return id; }
@Override public CassandraNotification save(CassandraNotification object) { LOG.debug("Save notification {} ", object); if (isBlank(object.getId())) { object.generateId(); } return super.save(object); }
/** * Create new instance of <code>CassandraNotification</code>. * * @param dto data transfer object contain data that * assign on fields of new instance */ public CassandraNotification(NotificationDto dto) { this.applicationId = dto.getApplicationId(); this.schemaId = dto.getSchemaId(); this.topicId = dto.getTopicId(); this.type = dto.getType(); this.nfVersion = dto.getNfVersion(); this.seqNum = dto.getSecNum(); this.lastModifyTime = dto.getLastTimeModify(); this.body = getByteBuffer(dto.getBody()); this.expiredAt = dto.getExpiredAt(); this.seqNum = dto.getSecNum(); this.id = dto.getId(); if (isBlank(id)) { generateId(); } }