/** * Tests whether the IP version of this entry is IPv6. * * @return true if the IP version of this entry is IPv6, otherwise false. */ public boolean isIp6() { return ipPrefix.isIp6(); }
/** * Gets the {@link Ip6Prefix} view of the IP prefix. * * @return the {@link Ip6Prefix} view of the IP prefix if it is IPv6, * otherwise null */ public Ip6Prefix getIp6Prefix() { if (!isIp6()) { return null; } // Return this object itself if it is already instance of Ip6Prefix if (this instanceof Ip6Prefix) { return (Ip6Prefix) this; } return Ip6Prefix.valueOf(address.getIp6Address(), prefixLength); }