public static List<PassIndLinkWrapper> wrapList( List<PassIndLink> passIndLinks, List<Passport> passports, List<Indicator> indicators, List<Measure> measures) { if ((passIndLinks == null) || passIndLinks.isEmpty()) { return null; } else { HashMap<Long, Passport> passportMap = new HashMap<Long, Passport>(); for (Passport passport : passports) { passportMap.put(passport.getId(), passport); } HashMap<Long, Indicator> indicatorMap = new HashMap<Long, Indicator>(); for (Indicator indicator : indicators) { indicatorMap.put(indicator.getId(), indicator); } HashMap<Long, Measure> measureMap = new HashMap<Long, Measure>(); for (Measure measure : measures) { measureMap.put(measure.getId(), measure); } ArrayList<PassIndLinkWrapper> passIndLinkWrappers = new ArrayList<PassIndLinkWrapper>(); for (PassIndLink passIndLink : passIndLinks) { passIndLinkWrappers.add( new PassIndLinkWrapper( passIndLink, passportMap.get(passIndLink.getPassId()), indicatorMap.get(passIndLink.getIndId()), measureMap.get(passIndLink.getMeasureId()))); } return passIndLinkWrappers; } }
public PassIndLinkWrapper(PassIndLink passIndLink) { super(); this.setId(passIndLink.getId()); this.setPassId(passIndLink.getPassId()); this.setIndId(passIndLink.getIndId()); this.setMeasureId(passIndLink.getMeasureId()); this.setDatatype(passIndLink.getDatatype()); this.setDataformat(passIndLink.getDataformat()); this.setOrdernum(passIndLink.getOrdernum()); this.setDataFormatEmessage(passIndLink.getDataFormatEmessage()); this.setDataFormatRmessage(passIndLink.getDataFormatRmessage()); this.setDataFormatKmessage(passIndLink.getDataFormatKmessage()); }
public PassIndLinkWrapper( PassIndLink passIndLink, Passport passport, Indicator indicator, Measure measure) { super(); this.setId(passIndLink.getId()); this.setPassId(passIndLink.getPassId()); this.setIndId(passIndLink.getIndId()); this.setMeasureId(passIndLink.getMeasureId()); this.setDatatype(passIndLink.getDatatype()); this.setDataformat(passIndLink.getDataformat()); this.setOrdernum(passIndLink.getOrdernum()); this.setDataFormatEmessage(passIndLink.getDataFormatEmessage()); this.setDataFormatRmessage(passIndLink.getDataFormatRmessage()); this.setDataFormatKmessage(passIndLink.getDataFormatKmessage()); this.passport = passport; this.indicator = indicator; this.measure = measure; }