@Test public void testGetResultNodeEndpoints() { AddNodeEntry entry = new AddNodeEntry(1, 1, Collections.emptySet(), new NodeEndpoint("A", "localhost", 2333)); Set<NodeEndpoint> nodeEndpoints = entry.getResultNodeEndpoints(); Assert.assertEquals(1, nodeEndpoints.size()); Assert.assertEquals(NodeId.of("A"), nodeEndpoints.iterator().next().getId()); }
public Set<NodeEndpoint> getResultNodeEndpoints() { Set<NodeEndpoint> configs = new HashSet<>(getNodeEndpoints()); configs.add(newNodeEndpoint); return configs; }
AddNodeEntry extends GroupConfigEntry { public Set<NodeEndpoint> getResultNodeEndpoints() { Set<NodeEndpoint> configs = new HashSet<>(getNodeEndpoints()); configs.add(newNodeEndpoint); return configs; } }
AddNodeEntry extends GroupConfigEntry { public Set<NodeEndpoint> getResultNodeEndpoints() { Set<NodeEndpoint> configs = new HashSet<>(getNodeEndpoints()); configs.add(newNodeEndpoint); return configs; } AddNodeEntry(int index, int term, Set<NodeEndpoint> nodeEndpoints, NodeEndpoint newNodeEndpoint); }
AddNodeEntry extends GroupConfigEntry { public Set<NodeEndpoint> getResultNodeEndpoints() { Set<NodeEndpoint> configs = new HashSet<>(getNodeEndpoints()); configs.add(newNodeEndpoint); return configs; } AddNodeEntry(int index, int term, Set<NodeEndpoint> nodeEndpoints, NodeEndpoint newNodeEndpoint); NodeEndpoint getNewNodeEndpoint(); Set<NodeEndpoint> getResultNodeEndpoints(); @Override byte[] getCommandBytes(); @Override String toString(); }
AddNodeEntry extends GroupConfigEntry { public Set<NodeEndpoint> getResultNodeEndpoints() { Set<NodeEndpoint> configs = new HashSet<>(getNodeEndpoints()); configs.add(newNodeEndpoint); return configs; } AddNodeEntry(int index, int term, Set<NodeEndpoint> nodeEndpoints, NodeEndpoint newNodeEndpoint); NodeEndpoint getNewNodeEndpoint(); Set<NodeEndpoint> getResultNodeEndpoints(); @Override byte[] getCommandBytes(); @Override String toString();  }