@Test public void toServer() throws Exception { assertEquals(serverProto, ChannelzProtoUtil.toServer(server)); server.serverStats = toBuilder(server.serverStats) .setListenSockets(ImmutableList.<InternalInstrumented<SocketStats>>of(listenSocket)) .build(); assertEquals( serverProto .toBuilder() .addListenSocket(listenSocketRef) .build(), ChannelzProtoUtil.toServer(server)); TestListenSocket otherListenSocket = new TestListenSocket(); SocketRef otherListenSocketRef = ChannelzProtoUtil.toSocketRef(otherListenSocket); server.serverStats = toBuilder(server.serverStats) .setListenSockets( ImmutableList.<InternalInstrumented<SocketStats>>of(listenSocket, otherListenSocket)) .build(); assertEquals( serverProto .toBuilder() .addListenSocket(listenSocketRef) .addListenSocket(otherListenSocketRef) .build(), ChannelzProtoUtil.toServer(server)); }
static Server toServer(InternalInstrumented<ServerStats> obj) { ServerStats stats = getFuture(obj.getStats()); Server.Builder builder = Server .newBuilder() .setRef(toServerRef(obj)) .setData(toServerData(stats)); for (InternalInstrumented<SocketStats> listenSocket : stats.listenSockets) { builder.addListenSocket(toSocketRef(listenSocket)); } return builder.build(); }
ChannelzProtoUtil { static Server toServer(InternalInstrumented<ServerStats> obj) { ServerStats stats = getFuture(obj.getStats()); Server.Builder builder = Server .newBuilder() .setRef(toServerRef(obj)) .setData(toServerData(stats)); for (InternalInstrumented<SocketStats> listenSocket : stats.listenSockets) { builder.addListenSocket(toSocketRef(listenSocket)); } return builder.build(); } }
ChannelzProtoUtil { static Server toServer(InternalInstrumented<ServerStats> obj) { ServerStats stats = getFuture(obj.getStats()); Server.Builder builder = Server .newBuilder() .setRef(toServerRef(obj)) .setData(toServerData(stats)); for (InternalInstrumented<SocketStats> listenSocket : stats.listenSockets) { builder.addListenSocket(toSocketRef(listenSocket)); } return builder.build(); } private  ChannelzProtoUtil(); }
ChannelzProtoUtil { static Server toServer(InternalInstrumented<ServerStats> obj) { ServerStats stats = getFuture(obj.getStats()); Server.Builder builder = Server .newBuilder() .setRef(toServerRef(obj)) .setData(toServerData(stats)); for (InternalInstrumented<SocketStats> listenSocket : stats.listenSockets) { builder.addListenSocket(toSocketRef(listenSocket)); } return builder.build(); } private  ChannelzProtoUtil();  }
ChannelzProtoUtil { static Server toServer(InternalInstrumented<ServerStats> obj) { ServerStats stats = getFuture(obj.getStats()); Server.Builder builder = Server .newBuilder() .setRef(toServerRef(obj)) .setData(toServerData(stats)); for (InternalInstrumented<SocketStats> listenSocket : stats.listenSockets) { builder.addListenSocket(toSocketRef(listenSocket)); } return builder.build(); } private  ChannelzProtoUtil();  static final String SO_LINGER; static final String SO_TIMEOUT; static final String TCP_INFO; }