private void initLocalContainerList() { if (this.containerList != null) { return; } GetContainersResponseProtoOrBuilder p = viaProto ? proto : builder; List<ContainerReportProto> list = p.getContainersList(); containerList = new ArrayList<ContainerReport>(); for (ContainerReportProto c : list) { containerList.add(convertFromProtoFormat(c)); } }
private void addLocalContainersToProto() { maybeInitBuilder(); builder.clearContainers(); if (containerList == null) { return; } Iterable<ContainerReportProto> iterable = new Iterable<ContainerReportProto>() { @Override public Iterator<ContainerReportProto> iterator() { return new Iterator<ContainerReportProto>() { Iterator<ContainerReport> iter = containerList.iterator(); @Override public boolean hasNext() { return iter.hasNext(); } @Override public ContainerReportProto next() { return convertToProtoFormat(iter.next()); } @Override public void remove() { throw new UnsupportedOperationException(); } }; } }; builder.addAllContainers(iterable); }
public ContainerReportProto getProto() { mergeLocalToProto(); proto = viaProto ? proto : builder.build(); viaProto = true; return proto; }
private ContainerReportPBImpl convertFromProtoFormat(ContainerReportProto p) { return new ContainerReportPBImpl(p); }
private ContainerReportProto convertToProtoFormat(ContainerReport t) { return ((ContainerReportPBImpl) t).getProto(); }
public ContainerReportPBImpl() { builder = ContainerReportProto.newBuilder(); }
public ContainerReportPBImpl(ContainerReportProto proto) { this.proto = proto; viaProto = true; }
private void maybeInitBuilder() { if (viaProto || builder == null) { builder = ContainerReportProto.newBuilder(proto); } viaProto = false; }
@Test public void testContainerReportPBImpl() throws Exception { validatePBImplRecord(ContainerReportPBImpl.class, ContainerReportProto.class); }