@Override protected GenericModel<EventClassDto> newInstance(Long id) { return new EventClass(id); }
/** * Instantiates the EventClassFamilyVersion. */ public EventClassFamilyVersion(EventClassFamilyVersionDto dto) { this.id = getLongId(dto.getId()); this.version = dto.getVersion(); this.createdUsername = dto.getCreatedUsername(); this.createdTime = dto.getCreatedTime(); if (dto.getRecords() != null) { this.records = new ArrayList<>(dto.getRecords().size()); for (EventClassDto record : dto.getRecords()) { this.records.add(new EventClass(record)); } } }
/** * Instantiates the ApplicationEventMap. */ public ApplicationEventMap(ApplicationEventMapDto dto) { this.id = getLongId(dto.getId()); Long eventClassId = getLongId(dto.getEventClassId()); if (eventClassId != null) { this.eventClass = new EventClass(eventClassId); } this.fqn = dto.getFqn(); this.action = dto.getAction(); }
protected List<EventClassFamilyVersion> generateEventClassFamilyVersion(EventClassFamily eventClassFamily, int ecfvCount, int ecCount) { List<EventClassFamilyVersion> ecfvList = new ArrayList<>(ecfvCount); for (int i = 0; i < ecfvCount; i++) { EventClassFamilyVersion ecfv = new EventClassFamilyVersion(); List<EventClass> ecList = new ArrayList<>(); for (int j = 0; j < ecCount; j++) { EventClass ec = new EventClass(); ec.setTenant(eventClassFamily.getTenant()); Optional<CtlSchema> ctlMaxVersion = ctlSchemaDao.find().stream() .max((ctl1, ctl2) -> Integer.compare(ctl1.getVersion(), ctl2.getVersion())); int version = ctlMaxVersion.isPresent() ? (ctlMaxVersion.get().getVersion() + 1) : 1; ec.setCtlSchema(generateCTLSchema(DEFAULT_FQN, version, eventClassFamily.getTenant(), CTLSchemaScopeDto.TENANT)); ec.setEcfv(ecfv); ec.setFqn("Test FQN" + RANDOM.nextInt()); ec.setType(EventClassType.EVENT); ecList.add(ec); } ecfv.setRecords(ecList); ecfvList.add(ecfv); } return ecfvList; }
EventClass currentEvent = new EventClass(items.get(position).get("name").toString(), items.get(position).get("location"), items.get(position).get("date") , items.get(position).get("type"), items.get(position).get("theme"),items.get(position).get("link"));