private void initLocalApplicationAttemptsList() { if (this.applicationAttemptList != null) { return; } GetApplicationAttemptsResponseProtoOrBuilder p = viaProto ? proto : builder; List<ApplicationAttemptReportProto> list = p.getApplicationAttemptsList(); applicationAttemptList = new ArrayList<ApplicationAttemptReport>(); for (ApplicationAttemptReportProto a : list) { applicationAttemptList.add(convertFromProtoFormat(a)); } }
private void addLocalApplicationAttemptsToProto() { maybeInitBuilder(); builder.clearApplicationAttempts(); if (applicationAttemptList == null) { return; } Iterable<ApplicationAttemptReportProto> iterable = new Iterable<ApplicationAttemptReportProto>() { @Override public Iterator<ApplicationAttemptReportProto> iterator() { return new Iterator<ApplicationAttemptReportProto>() { Iterator<ApplicationAttemptReport> iter = applicationAttemptList .iterator(); @Override public boolean hasNext() { return iter.hasNext(); } @Override public ApplicationAttemptReportProto next() { return convertToProtoFormat(iter.next()); } @Override public void remove() { throw new UnsupportedOperationException(); } }; } }; builder.addAllApplicationAttempts(iterable); }
private ApplicationAttemptReportPBImpl convertFromProtoFormat( ApplicationAttemptReportProto p) { return new ApplicationAttemptReportPBImpl(p); }
private ApplicationAttemptReportProto convertToProtoFormat( ApplicationAttemptReport t) { return ((ApplicationAttemptReportPBImpl) t).getProto(); }
public ApplicationAttemptReportPBImpl() { builder = ApplicationAttemptReportProto.newBuilder(); }
public ApplicationAttemptReportPBImpl(ApplicationAttemptReportProto proto) { this.proto = proto; viaProto = true; }
public ApplicationAttemptReportProto getProto() { mergeLocalToProto(); proto = viaProto ? proto : builder.build(); viaProto = true; return proto; }
private void maybeInitBuilder() { if (viaProto || builder == null) { builder = ApplicationAttemptReportProto.newBuilder(proto); } viaProto = false; }
@Test public void testApplicationAttemptReportPBImpl() throws Exception { validatePBImplRecord(ApplicationAttemptReportPBImpl.class, ApplicationAttemptReportProto.class); }