Package ru.bgcrm.util.inet
Class IpAddress
java.lang.Object
ru.bgcrm.util.inet.IpAddress
- All Implemented Interfaces:
Serializable
,Comparable<IpAddress>
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionbyte[]
static final Comparator
<byte[]> static final IpAddress
static final IpAddress
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
clone()
static final int
compare
(byte[] v1, byte[] v2) static final int
compare
(byte[] v1, int i, int len1, byte[] v2, int j, int len2) int
static byte[]
convertBigIntToIp4Address
(BigInteger bigInteger) static BigInteger
convertIp4AddresToBigInt
(byte[] address) static boolean
equals
(byte[] a, byte[] a2) boolean
static String
formatRange
(byte[] from, byte[] to) Deprecated.static String
formatRange
(IpAddress from, IpAddress to) Deprecated.- useinvalid reference
IpResourceRange#toString(IpAddress, IpAddress)
int
hashCode()
static int
hashCode
(byte[] a) static boolean
increment
(byte[] ip) static boolean
increment
(byte[] ip, int fromBit) static boolean
instersect
(byte[] addressFrom, byte[] addressTo, byte[] addressFrom2, byte[] addressTo2) Deprecated.- useinvalid reference
IpResourceRange#intersects(byte[], byte[], byte[], byte[])
static boolean
ipInRange
(byte[] ip, byte[] addressFrom, byte[] addressTo) Deprecated.- useinvalid reference
IpResourceRange#inRange(byte[], byte[], byte[], byte[])
static byte[]
newAndDecrement
(byte[] ip) static byte[]
newAndIncrement
(byte[] ip) static boolean
rangeInRange
(byte[] addressFrom, byte[] addressTo, byte[] addressFrom2, byte[] addressTo2) Deprecated.- useinvalid reference
IpResourceRange#inRange(byte[], byte[], byte[], byte[])
toString()
static String
toString
(byte[] address) static void
toString
(byte[] address, StringBuilder sb)
-
Field Details
-
ZERO_ADDRESS
-
IPV6_ZERO_ADDRESS
-
address
public byte[] address -
comparator
-
-
Constructor Details
-
IpAddress
public IpAddress() -
IpAddress
public IpAddress(byte[] address)
-
-
Method Details
-
hashCode
public int hashCode() -
hashCode
public static int hashCode(byte[] a) -
equals
-
equals
public static boolean equals(byte[] a, byte[] a2) -
clear
public void clear() -
toString
-
toString
-
toString
-
compare
public static final int compare(byte[] v1, byte[] v2) -
compare
public static final int compare(byte[] v1, int i, int len1, byte[] v2, int j, int len2) -
newAndIncrement
public static byte[] newAndIncrement(byte[] ip) -
increment
public static boolean increment(byte[] ip) -
increment
public static boolean increment(byte[] ip, int fromBit) -
newAndDecrement
public static byte[] newAndDecrement(byte[] ip) -
compareTo
- Specified by:
compareTo
in interfaceComparable<IpAddress>
-
clone
-
instersect
@Deprecated public static boolean instersect(byte[] addressFrom, byte[] addressTo, byte[] addressFrom2, byte[] addressTo2) Deprecated.- useinvalid reference
IpResourceRange#intersects(byte[], byte[], byte[], byte[])
- Parameters:
addressFrom
-addressTo
-addressFrom2
-addressTo2
-- Returns:
-
rangeInRange
@Deprecated public static boolean rangeInRange(byte[] addressFrom, byte[] addressTo, byte[] addressFrom2, byte[] addressTo2) Deprecated.- useinvalid reference
IpResourceRange#inRange(byte[], byte[], byte[], byte[])
- Parameters:
addressFrom
-addressTo
-addressFrom2
-addressTo2
-- Returns:
-
ipInRange
Deprecated.- useinvalid reference
IpResourceRange#inRange(byte[], byte[], byte[], byte[])
- Parameters:
ip
-addressFrom
-addressTo
-- Returns:
-
convertIp4AddresToBigInt
- Parameters:
address
-- Returns:
-
convertBigIntToIp4Address
- Parameters:
bigInteger
-- Returns:
-
formatRange
Deprecated.- useinvalid reference
IpResourceRange#toString(IpAddress, IpAddress)
- Parameters:
from
-to
-- Returns:
-
formatRange
Deprecated.- useinvalid reference
IpResourceRange#toString(byte[], byte[])
- Parameters:
from
-to
-- Returns:
-
invalid reference