private void initLocalApplicationsList() { if (this.applicationList != null) { return; } GetApplicationsResponseProtoOrBuilder p = viaProto ? proto : builder; List<ApplicationReportProto> list = p.getApplicationsList(); applicationList = new ArrayList<ApplicationReport>(); for (ApplicationReportProto a : list) { applicationList.add(convertFromProtoFormat(a)); } }
private void addLocalApplicationsToProto() { maybeInitBuilder(); builder.clearApplications(); if (applicationList == null) return; Iterable<ApplicationReportProto> iterable = new Iterable<ApplicationReportProto>() { @Override public Iterator<ApplicationReportProto> iterator() { return new Iterator<ApplicationReportProto>() { Iterator<ApplicationReport> iter = applicationList.iterator(); @Override public boolean hasNext() { return iter.hasNext(); } @Override public ApplicationReportProto next() { return convertToProtoFormat(iter.next()); } @Override public void remove() { throw new UnsupportedOperationException(); } }; } }; builder.addAllApplications(iterable); }
private void initLocalApplicationsList() { if (this.applicationsList != null) { return; } QueueInfoProtoOrBuilder p = viaProto ? proto : builder; List<ApplicationReportProto> list = p.getApplicationsList(); applicationsList = new ArrayList<ApplicationReport>(); for (ApplicationReportProto a : list) { applicationsList.add(convertFromProtoFormat(a)); } }
private void addApplicationsToProto() { maybeInitBuilder(); builder.clearApplications(); if (applicationsList == null) return; Iterable<ApplicationReportProto> iterable = new Iterable<ApplicationReportProto>() { @Override public Iterator<ApplicationReportProto> iterator() { return new Iterator<ApplicationReportProto>() { Iterator<ApplicationReport> iter = applicationsList.iterator(); @Override public boolean hasNext() { return iter.hasNext(); } @Override public ApplicationReportProto next() { return convertToProtoFormat(iter.next()); } @Override public void remove() { throw new UnsupportedOperationException(); } }; } }; builder.addAllApplications(iterable); }
private ApplicationReportPBImpl convertFromProtoFormat(ApplicationReportProto p) { return new ApplicationReportPBImpl(p); }
private ApplicationReportProto convertToProtoFormat(ApplicationReport t) { return ((ApplicationReportPBImpl)t).getProto(); }