@Beta public abstract class AbstractIetfInetUtil<A4,A4NZ extends A4,P4,A6,A6NZ extends A6,P6,A,ANZ,P> extends Object
Modifier | Constructor and Description |
---|---|
protected |
AbstractIetfInetUtil(Class<A4> addr4Class,
Class<A4NZ> addr4nzClass,
Class<P4> prefix4Class,
Class<A6> addr6Class,
Class<A6NZ> addr6nzClass,
Class<P6> prefix6Class) |
Modifier and Type | Method and Description |
---|---|
@NonNull Inet4Address |
inet4AddressFor(A4 addr) |
@NonNull Inet4Address |
inet4AddressForNoZone(A4NZ addr) |
@NonNull Inet6Address |
inet6AddressFor(A6 addr) |
@NonNull Inet6Address |
inet6AddressForNoZone(A6NZ addr) |
@NonNull InetAddress |
inetAddressFor(A addr) |
@NonNull InetAddress |
inetAddressForNoZone(ANZ addr) |
A |
ipAddressFor(byte[] bytes)
Create an IpAddress by interpreting input bytes as an IPv4 or IPv6 address, based on array length.
|
A |
ipAddressFor(@NonNull InetAddress addr) |
ANZ |
ipAddressNoZoneFor(byte[] bytes)
Create an IpAddress by interpreting input bytes as an IPv4 or IPv6 address, based on array length.
|
ANZ |
ipAddressNoZoneFor(@NonNull InetAddress addr) |
P |
ipPrefixFor(byte[] bytes,
int mask)
Create an IpPrefix by combining the address with a mask.
|
P |
ipPrefixFor(@NonNull 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(@NonNull InetAddress addr)
Create an Ipv4Address by interpreting an
Inet4Address . |
A4 |
ipv4AddressFrom(P4 prefix) |
protected abstract ANZ |
ipv4AddressNoZone(A4NZ addr) |
byte[] |
ipv4AddressNoZoneBytes(A4NZ addr) |
A4NZ |
ipv4AddressNoZoneFor(byte[] bytes)
Create an Ipv4AddressNoZone by interpreting input bytes as an IPv4 address.
|
A4NZ |
ipv4AddressNoZoneFor(@NonNull InetAddress addr)
Create an Ipv4AddressNoZone by interpreting an
Inet4Address . |
A4NZ |
ipv4AddressNoZoneFrom(P4 prefix) |
protected abstract @NonNull 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(@NonNull InetAddress addr)
Create a /32 Ipv4Prefix for an
Inet4Address |
P4 |
ipv4PrefixFor(@NonNull InetAddress addr,
int mask)
Create a Ipv4Prefix by combining the address with a mask.
|
P4 |
ipv4PrefixForNoZone(A4NZ addr) |
P4 |
ipv4PrefixForNoZone(A4NZ addr,
int mask) |
P4 |
ipv4PrefixForShort(byte[] address,
int mask) |
P4 |
ipv4PrefixForShort(byte[] array,
int startOffset,
int mask) |
protected abstract @NonNull 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(@NonNull InetAddress addr)
Create an Ipv6Address by interpreting an
Inet6Address . |
A6 |
ipv6AddressFrom(P6 prefix) |
protected abstract ANZ |
ipv6AddressNoZone(A6NZ addr) |
byte[] |
ipv6AddressNoZoneBytes(A6NZ addr) |
A6NZ |
ipv6AddressNoZoneFor(byte[] bytes)
Create an Ipv6AddressNoZone by interpreting input bytes as an IPv6 address.
|
A6NZ |
ipv6AddressNoZoneFor(@NonNull InetAddress addr)
Create an Ipv6AddressNoZone by interpreting an
Inet6Address . |
A6NZ |
ipv6AddressNoZoneFrom(P6 prefix) |
protected abstract @NonNull 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(@NonNull InetAddress addr)
Create a /128 Ipv6Prefix by interpreting input bytes as an IPv4 address.
|
P6 |
ipv6PrefixFor(@NonNull InetAddress addr,
int mask)
Create a Ipv6Prefix by combining the address with a mask.
|
P6 |
ipv6PrefixForNoZone(A6NZ addr) |
P6 |
ipv6PrefixForNoZone(A6NZ addr,
int mask) |
P6 |
ipv6PrefixForShort(byte[] address,
int mask) |
P6 |
ipv6PrefixForShort(byte[] array,
int startOffset,
int mask) |
protected abstract @NonNull String |
ipv6PrefixString(P6 prefix) |
byte[] |
ipv6PrefixToBytes(P6 prefix) |
protected abstract A4 |
maybeIpv4Address(A addr) |
protected abstract A4NZ |
maybeIpv4AddressNoZone(ANZ addr) |
protected abstract A6 |
maybeIpv6Address(A addr) |
protected abstract A6NZ |
maybeIpv6AddressNoZone(ANZ addr) |
@NonNull Map.Entry<A4,Integer> |
splitIpv4Prefix(P4 prefix) |
@NonNull Map.Entry<A4NZ,Integer> |
splitIpv4PrefixNoZone(P4 prefix) |
@NonNull Map.Entry<A6,Integer> |
splitIpv6Prefix(P6 prefix) |
@NonNull Map.Entry<A6NZ,Integer> |
splitIpv6PrefixNoZone(P6 prefix) |
public final A ipAddressFor(byte[] bytes)
bytes
- 4-byte (IPv4) or 6-byte (IPv6) arrayIllegalArgumentException
- if bytes has length different from 4 or 6NullPointerException
- if bytes is nullpublic final A ipAddressFor(@NonNull InetAddress addr)
public final ANZ ipAddressNoZoneFor(byte[] bytes)
bytes
- 4-byte (IPv4) or 6-byte (IPv6) arrayIllegalArgumentException
- if bytes has length different from 4 or 6NullPointerException
- if bytes is nullpublic final ANZ ipAddressNoZoneFor(@NonNull InetAddress addr)
public final P ipPrefixFor(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 nullpublic final P ipPrefixFor(@NonNull InetAddress addr, int mask)
public final @NonNull InetAddress inetAddressFor(A addr)
public final @NonNull InetAddress inetAddressForNoZone(ANZ addr)
public final @NonNull Inet4Address inet4AddressFor(A4 addr)
public final @NonNull Inet4Address inet4AddressForNoZone(A4NZ addr)
public final @NonNull Inet6Address inet6AddressFor(A6 addr)
public final @NonNull Inet6Address inet6AddressForNoZone(A6NZ addr)
public final A4 ipv4AddressFor(byte[] bytes)
bytes
- 4-byte arrayIllegalArgumentException
- if bytes has length different from 4NullPointerException
- if bytes is nullpublic final A4 ipv4AddressFor(@NonNull InetAddress addr)
Inet4Address
.addr
- An Inet4Address
IllegalArgumentException
- if addr is not an Inet4Address
NullPointerException
- if addr is nullpublic final A4NZ ipv4AddressNoZoneFor(byte[] bytes)
bytes
- 4-byte arrayIllegalArgumentException
- if bytes has length different from 4NullPointerException
- if bytes is nullpublic final A4NZ ipv4AddressNoZoneFor(@NonNull InetAddress addr)
Inet4Address
.addr
- An Inet4Address
IllegalArgumentException
- if addr is not an Inet4Address
NullPointerException
- if addr is nullpublic final byte[] ipv4AddressBytes(A4 addr)
public final byte[] ipv4AddressNoZoneBytes(A4NZ addr)
public final P4 ipv4PrefixFor(byte[] bytes)
bytes
- four-byte arrayIllegalArgumentException
- if bytes has length different from 4NullPointerException
- if bytes is nullpublic final P4 ipv4PrefixFor(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 nullpublic final P4 ipv4PrefixForShort(byte[] address, int mask)
public final P4 ipv4PrefixForShort(byte[] array, int startOffset, int mask)
public final P4 ipv4PrefixFor(@NonNull InetAddress addr)
Inet4Address
addr
- An Inet4Address
IllegalArgumentException
- if addr is not an Inet4AddressNullPointerException
- if addr is nullpublic final P4 ipv4PrefixFor(@NonNull InetAddress addr, int mask)
addr
- An Inet4Address
mask
- Prefix maskIllegalArgumentException
- if addr is not an Inet4Address or if mask is not in range 0-32NullPointerException
- if addr is nullpublic final @NonNull Map.Entry<A4NZ,Integer> splitIpv4PrefixNoZone(P4 prefix)
public final byte[] ipv4PrefixToBytes(P4 prefix)
public final A6 ipv6AddressFor(byte[] bytes)
bytes
- 16-byte arrayIllegalArgumentException
- if bytes has length different from 16NullPointerException
- if bytes is nullpublic final A6 ipv6AddressFor(@NonNull InetAddress addr)
Inet6Address
.addr
- An Inet6Address
IllegalArgumentException
- if addr is not an Inet6Address
NullPointerException
- if addr is nullpublic final A6NZ ipv6AddressNoZoneFor(byte[] bytes)
bytes
- 16-byte arrayIllegalArgumentException
- if bytes has length different from 16NullPointerException
- if bytes is nullpublic final A6NZ ipv6AddressNoZoneFor(@NonNull InetAddress addr)
Inet6Address
.addr
- An Inet6Address
IllegalArgumentException
- if addr is not an Inet6Address
NullPointerException
- if addr is nullpublic final byte[] ipv6AddressBytes(A6 addr)
public final byte[] ipv6AddressNoZoneBytes(A6NZ addr)
public final P6 ipv6PrefixFor(byte[] bytes)
bytes
- four-byte arrayIllegalArgumentException
- if bytes has length different from 16NullPointerException
- if bytes is nullpublic final P6 ipv6PrefixFor(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 nullpublic final P6 ipv6PrefixForShort(byte[] address, int mask)
public final P6 ipv6PrefixForShort(byte[] array, int startOffset, int mask)
public final P6 ipv6PrefixFor(@NonNull InetAddress addr)
addr
- an Inet6Address
IllegalArgumentException
- if addr is not an Inet6Address or if mask is not in range 0-128NullPointerException
- if addr is nullpublic 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 nullpublic final @NonNull Map.Entry<A6NZ,Integer> splitIpv6PrefixNoZone(P6 prefix)
public final byte[] ipv6PrefixToBytes(P6 prefix)
Copyright © 2019 OpenDaylight. All rights reserved.