@Immutable public class IPV4Addr extends Object implements Serializable
| Modifier and Type | Field and Description |
|---|---|
static int |
PART_MAX_VALUE |
static int |
PART_MIN_VALUE |
static int |
PARTS |
static String |
PATTERN_IPV4
A regular expression pattern to validate IPv4 addresses
|
| Constructor and Description |
|---|
IPV4Addr(byte[] aAddressBytes) |
IPV4Addr(InetAddress aAddress) |
IPV4Addr(int n1,
int n2,
int n3,
int n4)
Constructor that creates an IP address from the 4 numbers.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
String |
getAsString() |
int[] |
getNumberParts() |
int |
hashCode() |
static IPV4Addr |
parse(String sText)
Parse the provided IPv4 address from the text string (as e.g
|
String |
toString() |
public static final String PATTERN_IPV4
public static final int PARTS
public static final int PART_MIN_VALUE
public static final int PART_MAX_VALUE
public IPV4Addr(@Nonnull InetAddress aAddress)
public IPV4Addr(@Nonnull byte[] aAddressBytes)
public IPV4Addr(@Nonnegative int n1, @Nonnegative int n2, @Nonnegative int n3, @Nonnegative int n4)
n1 - first numbern2 - second numbern3 - third numbern4 - fourth number@Nonnull @ReturnsMutableCopy public int[] getNumberParts()
@Nonnull public String getAsString()
@Nonnull public static IPV4Addr parse(@Nonnull String sText)
sText - The text to be parsed. May not be null.null.IllegalArgumentException - If the passed string is not a valid IPv4 addressCopyright © 2016–2019 Philip Helger. All rights reserved.