@Test public void testCreateNodeId() throws Exception { assertEquals(node1, NodeIdConv.createNodeId(Inet4Address.getByName("127.0.0.1"))); assertEquals(node2, NodeIdConv.createNodeId(Inet4Address.getByName("0.0.0.1"))); assertEquals(node3, NodeIdConv.createNodeId(Inet4Address.getByName("127.124.56.1"))); assertEquals(node1, NodeIdConv.createNodeId("127.0.0.1")); assertEquals(node2, NodeIdConv.createNodeId("0.0.0.1")); assertEquals(node3, NodeIdConv.createNodeId("127.124.56.1")); }
public static NodeId createNodeId(InetAddress inetAddress) throws UnknownNodeIdException { if (inetAddress instanceof Inet4Address) { return new NodeId(IetfInetUtil.INSTANCE.ipv4AddressFor(inetAddress)); } throw new UnknownNodeIdException("Not IPv4 format [\"" + inetAddress.toString() + "\"]"); }
NodeIdConv { public static NodeId createNodeId(InetAddress inetAddress) throws UnknownNodeIdException { if (inetAddress instanceof Inet4Address) { return new NodeId(IetfInetUtil.INSTANCE.ipv4AddressFor(inetAddress)); } throw new UnknownNodeIdException("Not IPv4 format [\"" + inetAddress.toString() + "\"]"); } }
NodeIdConv { public static NodeId createNodeId(InetAddress inetAddress) throws UnknownNodeIdException { if (inetAddress instanceof Inet4Address) { return new NodeId(IetfInetUtil.INSTANCE.ipv4AddressFor(inetAddress)); } throw new UnknownNodeIdException("Not IPv4 format [\"" + inetAddress.toString() + "\"]"); } private  NodeIdConv(); }
NodeIdConv { public static NodeId createNodeId(InetAddress inetAddress) throws UnknownNodeIdException { if (inetAddress instanceof Inet4Address) { return new NodeId(IetfInetUtil.INSTANCE.ipv4AddressFor(inetAddress)); } throw new UnknownNodeIdException("Not IPv4 format [\"" + inetAddress.toString() + "\"]"); } private  NodeIdConv(); static NodeId _decode(byte[] array); static NodeId create(int nodeId); static NodeId createNodeId(InetAddress inetAddress); static NodeId createNodeId(String prefix); static PeerSequence createPeerSequence(List<NodeId> nodeIds); static List<NodeId> decode(byte[] array); static boolean equalTo(NodeId nodeId1, NodeId nodeId2); static List<NodeId> getPeerSequence(PeerSequence peerSequence); static byte[] toBytes(List<NodeId> nodesIds); static byte[] toBytes(NodeId nodeId); static String toString(NodeId nodeId); static String toString(PeerSequence peerSequence); }
NodeIdConv { public static NodeId createNodeId(InetAddress inetAddress) throws UnknownNodeIdException { if (inetAddress instanceof Inet4Address) { return new NodeId(IetfInetUtil.INSTANCE.ipv4AddressFor(inetAddress)); } throw new UnknownNodeIdException("Not IPv4 format [\"" + inetAddress.toString() + "\"]"); } private  NodeIdConv(); static NodeId _decode(byte[] array); static NodeId create(int nodeId); static NodeId createNodeId(InetAddress inetAddress); static NodeId createNodeId(String prefix); static PeerSequence createPeerSequence(List<NodeId> nodeIds); static List<NodeId> decode(byte[] array); static boolean equalTo(NodeId nodeId1, NodeId nodeId2); static List<NodeId> getPeerSequence(PeerSequence peerSequence); static byte[] toBytes(List<NodeId> nodesIds); static byte[] toBytes(NodeId nodeId); static String toString(NodeId nodeId); static String toString(PeerSequence peerSequence);  }