public static String getStringIpPrefix(IpPrefix ipPrefix) { if (ipPrefix.getIpv4Prefix() != null) { return ipPrefix.getIpv4Prefix().getValue(); } return ipPrefix.getIpv6Prefix().getValue(); }
public static String getStringIpAddress(IpAddress ipAddress) { if (ipAddress.getIpv4Address() != null) { return ipAddress.getIpv4Address().getValue(); } return ipAddress.getIpv6Address().getValue(); }
private boolean isHostAddressPresent(final Host address) { return address.getDomainName() != null || address.getIpAddress() != null && (address.getIpAddress().getIpv4Address() != null || address.getIpAddress().getIpv6Address() != null); }
private InetSocketAddress getSocketAddress() { if(getAddress().getDomainName() != null) { return new InetSocketAddress(getAddress().getDomainName().getValue(), getPort().getValue()); } else { final IpAddress ipAddress = getAddress().getIpAddress(); final String ip = ipAddress.getIpv4Address() != null ? ipAddress.getIpv4Address().getValue() : ipAddress.getIpv6Address().getValue(); return new InetSocketAddress(ip, getPort().getValue()); } }
@Override public int hashCode() { if (hashValid) { return hash; } final int prime = 31; int result = 1; result = prime * result + ((_subscriberId == null) ? 0 : _subscriberId.hashCode()); hash = result; hashValid = true; return result; }
@Override protected Ipv6Address maybeIpv6Address(final IpAddress addr) { return addr.getIpv6Address(); } }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((_ipv4Address == null) ? 0 : _ipv4Address.hashCode()); result = prime * result + ((_ipv6Address == null) ? 0 : _ipv6Address.hashCode()); result = prime * result + ((_value == null) ? 0 : Arrays.hashCode(_value)); return result; }
/** * Create ipv4 prefix from ipv4 address, by appending /32 mask * * @param ipv4AddressString the ip address, in string format * @return Ipv4Prefix with ipv4Address and /32 mask */ public static Ipv4Prefix iPv4PrefixFromIPv4Address(String ipv4AddressString) { return new Ipv4Prefix(ipv4AddressString + "/32"); }
@Override public String apply(final Uri uri) { return uri.getValue(); } }));
/** * Create ipv6 prefix from ipv6 address, by appending /128 mask * * @param ipv6AddressString the ip address, in string format * @return Ipv6Prefix with ipv6Address and /128 mask */ public static Ipv6Prefix iPv6PrefixFromIPv6Address(String ipv6AddressString) { return new Ipv6Prefix(ipv6AddressString + "/128"); }
public Host(IpAddress _ipAddress) { super(); this._ipAddress = _ipAddress; this._domainName = null; this._value = _ipAddress.getValue(); }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((_ipv6Prefix == null) ? 0 : _ipv6Prefix.hashCode()); return result; }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((_ipv4Prefix == null) ? 0 : _ipv4Prefix.hashCode()); return result; }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((_prefix == null) ? 0 : _prefix.hashCode()); return result; }
@Override public int hashCode() { if (hashValid) { return hash; } final int prime = 31; int result = 1; result = prime * result + ((_subscriberId == null) ? 0 : _subscriberId.hashCode()); hash = result; hashValid = true; return result; }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((_prefix == null) ? 0 : _prefix.hashCode()); return result; }
@Override public int hashCode() { if (hashValid) { return hash; } final int prime = 31; int result = 1; result = prime * result + ((_subscriberId == null) ? 0 : _subscriberId.hashCode()); hash = result; hashValid = true; return result; }
@Override public int hashCode() { if (hashValid) { return hash; } final int prime = 31; int result = 1; result = prime * result + ((_subscriberId == null) ? 0 : _subscriberId.hashCode()); hash = result; hashValid = true; return result; }
@Override public int hashCode() { if (hashValid) { return hash; } final int prime = 31; int result = 1; result = prime * result + ((_subscriberId == null) ? 0 : _subscriberId.hashCode()); hash = result; hashValid = true; return result; }
@Override public int hashCode() { if (hashValid) { return hash; } final int prime = 31; int result = 1; result = prime * result + ((_subscriberId == null) ? 0 : _subscriberId.hashCode()); hash = result; hashValid = true; return result; }