@Beta public abstract class AbstractIetfInetUtil<A4,P4,A6,P6,A,P> extends Object
| Modifier | Constructor and Description | 
|---|---|
protected  | 
AbstractIetfInetUtil(Class<A4> addr4Class,
                    Class<P4> prefix4Class,
                    Class<A6> addr6Class,
                    Class<P6> prefix6Class)  | 
| Modifier and Type | Method and Description | 
|---|---|
Inet4Address | 
inet4AddressFor(A4 addr)  | 
Inet6Address | 
inet6AddressFor(A6 addr)  | 
InetAddress | 
inetAddressFor(A addr)  | 
A | 
ipAddressFor(byte[] bytes)
Create an IpAddress by interpreting input bytes as an IPv4 or IPv6 address, based on array length. 
 | 
A | 
ipAddressFor(InetAddress addr)  | 
P | 
ipPrefixFor(byte[] bytes,
           int mask)
Create an IpPrefix by combining the address with a mask. 
 | 
P | 
ipPrefixFor(InetAddress addr,
           int mask)  | 
protected abstract A | 
ipv4Address(A4 addr)  | 
byte[] | 
ipv4AddressBytes(A4 addr)  | 
A4 | 
ipv4AddressFor(byte[] bytes)
Create an Ipv4Address by interpreting input bytes as an IPv4 address. 
 | 
A4 | 
ipv4AddressFor(InetAddress addr)
Create an Ipv4Address by interpreting an  
Inet4Address. | 
A4 | 
ipv4AddressFrom(P4 prefix)  | 
protected abstract String | 
ipv4AddressString(A4 addr)  | 
protected abstract P | 
ipv4Prefix(P4 addr)  | 
P4 | 
ipv4PrefixFor(A4 addr)  | 
P4 | 
ipv4PrefixFor(A4 addr,
             int mask)  | 
P4 | 
ipv4PrefixFor(byte[] bytes)
Create a /32 Ipv4Prefix by interpreting input bytes as an IPv4 address. 
 | 
P4 | 
ipv4PrefixFor(byte[] address,
             int mask)
Create a Ipv4Prefix by combining the address with a mask. 
 | 
P4 | 
ipv4PrefixFor(InetAddress addr)
Create a /32 Ipv4Prefix for an  
Inet4Address | 
P4 | 
ipv4PrefixFor(InetAddress addr,
             int mask)
Create a Ipv4Prefix by combining the address with a mask. 
 | 
P4 | 
ipv4PrefixForShort(byte[] address,
                  int mask)  | 
P4 | 
ipv4PrefixForShort(byte[] array,
                  int startOffset,
                  int mask)  | 
protected abstract String | 
ipv4PrefixString(P4 prefix)  | 
byte[] | 
ipv4PrefixToBytes(P4 prefix)  | 
protected abstract A | 
ipv6Address(A6 addr)  | 
byte[] | 
ipv6AddressBytes(A6 addr)  | 
A6 | 
ipv6AddressFor(byte[] bytes)
Create an Ipv6Address by interpreting input bytes as an IPv6 address. 
 | 
A6 | 
ipv6AddressFor(InetAddress addr)
Create an Ipv6Address by interpreting an  
Inet6Address. | 
A6 | 
ipv6AddressFrom(P6 prefix)  | 
protected abstract String | 
ipv6AddressString(A6 addr)  | 
protected abstract P | 
ipv6Prefix(P6 addr)  | 
P6 | 
ipv6PrefixFor(A6 addr)  | 
P6 | 
ipv6PrefixFor(A6 addr,
             int mask)  | 
P6 | 
ipv6PrefixFor(byte[] bytes)
Create a /128 Ipv6Prefix by interpreting input bytes as an IPv6 address. 
 | 
P6 | 
ipv6PrefixFor(byte[] address,
             int mask)
Create a Ipv6Prefix by combining the address with a mask. 
 | 
P6 | 
ipv6PrefixFor(InetAddress addr)
Create a /128 Ipv6Prefix by interpreting input bytes as an IPv4 address. 
 | 
P6 | 
ipv6PrefixFor(InetAddress addr,
             int mask)
Create a Ipv6Prefix by combining the address with a mask. 
 | 
P6 | 
ipv6PrefixForShort(byte[] address,
                  int mask)  | 
P6 | 
ipv6PrefixForShort(byte[] array,
                  int startOffset,
                  int mask)  | 
protected abstract String | 
ipv6PrefixString(P6 prefix)  | 
byte[] | 
ipv6PrefixToBytes(P6 prefix)  | 
protected abstract A4 | 
maybeIpv4Address(A addr)  | 
protected abstract A6 | 
maybeIpv6Address(A addr)  | 
Map.Entry<A4,Integer> | 
splitIpv4Prefix(P4 prefix)  | 
Map.Entry<A6,Integer> | 
splitIpv6Prefix(P6 prefix)  | 
@Nonnull public final A ipAddressFor(@Nonnull byte[] bytes)
bytes - 4-byte (IPv4) or 6-byte (IPv6) arrayIllegalArgumentException - if bytes has length different from 4 or 6NullPointerException - if bytes is null@Nonnull public final A ipAddressFor(@Nonnull InetAddress addr)
@Nonnull public final P ipPrefixFor(@Nonnull byte[] bytes, int mask)
bytes - Input address as a 4-byte (IPv4) or 16-byte (IPv6) arraymask - Prefix maskIllegalArgumentException - if bytes has length different from 4 or 16 or if mask is not
         in range 0-32 or 0-128 respectivelyNullPointerException - if bytes is null@Nonnull public final P ipPrefixFor(@Nonnull InetAddress addr, int mask)
@Nonnull public final InetAddress inetAddressFor(@Nonnull A addr)
@Nonnull public final Inet4Address inet4AddressFor(@Nonnull A4 addr)
@Nonnull public final Inet6Address inet6AddressFor(@Nonnull A6 addr)
@Nonnull public final A4 ipv4AddressFor(@Nonnull byte[] bytes)
bytes - 4-byte arrayIllegalArgumentException - if bytes has length different from 4NullPointerException - if bytes is null@Nonnull public final A4 ipv4AddressFor(@Nonnull InetAddress addr)
Inet4Address.addr - An Inet4AddressIllegalArgumentException - if addr is not an Inet4AddressNullPointerException - if addr is null@Nonnull public final P4 ipv4PrefixFor(@Nonnull byte[] bytes)
bytes - four-byte arrayIllegalArgumentException - if bytes has length different from 4NullPointerException - if bytes is null@Nonnull public final P4 ipv4PrefixFor(@Nonnull byte[] address, int mask)
address = { 1, 2, 3, 4 }
 and mask=24 will result in 1.2.3.4/24.address - Input address as a 4-byte arraymask - Prefix maskIllegalArgumentException - if bytes has length different from 4 or if mask is not in range 0-32NullPointerException - if bytes is null@Nonnull public final P4 ipv4PrefixForShort(@Nonnull byte[] array, int startOffset, int mask)
@Nonnull public final P4 ipv4PrefixFor(@Nonnull InetAddress addr)
Inet4Addressaddr - An Inet4AddressIllegalArgumentException - if addr is not an Inet4AddressNullPointerException - if adds is null@Nonnull public final P4 ipv4PrefixFor(@Nonnull InetAddress addr, int mask)
addr - An Inet4Addressmask - Prefix maskIllegalArgumentException - if addr is not an Inet4Address or if mask is not in range 0-32NullPointerException - if addr is null@Nonnull public final A6 ipv6AddressFor(@Nonnull byte[] bytes)
bytes - 16-byte arrayIllegalArgumentException - if bytes has length different from 16NullPointerException - if bytes is null@Nonnull public final A6 ipv6AddressFor(@Nonnull InetAddress addr)
Inet6Address.addr - An Inet6AddressIllegalArgumentException - if addr is not an Inet6AddressNullPointerException - if addr is null@Nonnull public final P6 ipv6PrefixFor(@Nonnull byte[] bytes)
bytes - four-byte arrayIllegalArgumentException - if bytes has length different from 16NullPointerException - if bytes is null@Nonnull public final P6 ipv6PrefixFor(@Nonnull byte[] address, int mask)
address - Input address as a 16-byte arraymask - Prefix maskIllegalArgumentException - if bytes has length different from 16 or if mask is not in range 0-128NullPointerException - if bytes is null@Nonnull public final P6 ipv6PrefixForShort(@Nonnull byte[] array, int startOffset, int mask)
@Nonnull public final P6 ipv6PrefixFor(@Nonnull InetAddress addr)
addr - an Inet6AddressIllegalArgumentException - if addr is not an Inet6Address or if mask is not in range 0-128NullPointerException - if addr is null@Nonnull public final P6 ipv6PrefixFor(@Nonnull InetAddress addr, int mask)
addr - Input addressmask - Prefix maskIllegalArgumentException - if addr is not an Inet6Address or if mask is not in range 0-128NullPointerException - if addr is nullCopyright © 2018 OpenDaylight. All rights reserved.