Code example for InetAddress

Methods: getAddress

0
 */ 
public class RackInferringSnitch extends AbstractNetworkTopologySnitch 
{ 
    public String getRack(InetAddress endpoint)
    { 
        return Byte.toString(endpoint.getAddress()[2]);
    } 
 
    public String getDatacenter(InetAddress endpoint)
    { 
        return Byte.toString(endpoint.getAddress()[1]);
    } 
} 
Experience pair programming with AI  Get Codota for Java