private void initLocalChildQueuesList() { if (this.childQueuesList != null) { return; } QueueInfoProtoOrBuilder p = viaProto ? proto : builder; List<QueueInfoProto> list = p.getChildQueuesList(); childQueuesList = new ArrayList<QueueInfo>(); for (QueueInfoProto a : list) { childQueuesList.add(convertFromProtoFormat(a)); } }
private void addChildQueuesInfoToProto() { maybeInitBuilder(); builder.clearChildQueues(); if (childQueuesList == null) return; Iterable<QueueInfoProto> iterable = new Iterable<QueueInfoProto>() { @Override public Iterator<QueueInfoProto> iterator() { return new Iterator<QueueInfoProto>() { Iterator<QueueInfo> iter = childQueuesList.iterator(); @Override public boolean hasNext() { return iter.hasNext(); } @Override public QueueInfoProto next() { return convertToProtoFormat(iter.next()); } @Override public void remove() { throw new UnsupportedOperationException(); } }; } }; builder.addAllChildQueues(iterable); }
private QueueInfo convertFromProtoFormat(QueueInfoProto queueInfo) { return new QueueInfoPBImpl(queueInfo); }
private QueueInfoProto convertToProtoFormat(QueueInfo queueInfo) { return ((QueueInfoPBImpl)queueInfo).getProto(); }
public QueueInfoPBImpl() { builder = QueueInfoProto.newBuilder(); }
public QueueInfoPBImpl(QueueInfoProto proto) { this.proto = proto; viaProto = true; }
public QueueInfoProto getProto() { mergeLocalToProto(); proto = viaProto ? proto : builder.build(); viaProto = true; return proto; }
private void maybeInitBuilder() { if (viaProto || builder == null) { builder = QueueInfoProto.newBuilder(proto); } viaProto = false; }
private QueueInfoPBImpl convertFromProtoFormat(QueueInfoProto a) { return new QueueInfoPBImpl(a); }
private QueueInfoProto convertToProtoFormat(QueueInfo q) { return ((QueueInfoPBImpl)q).getProto(); }
@Test public void testQueueInfoPBImpl() throws Exception { validatePBImplRecord(QueueInfoPBImpl.class, QueueInfoProto.class); }