Package org.opennms.nephron.network
Class IPAddress
- java.lang.Object
-
- org.opennms.nephron.network.IPAddress
-
- All Implemented Interfaces:
Serializable,Comparable<IPAddress>
public class IPAddress extends Object implements Comparable<IPAddress>, Serializable
Copied from OpenNMS.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected InetAddressm_inetAddress
-
Constructor Summary
Constructors Constructor Description IPAddress(byte[] ipAddrOctets)IPAddress(String dottedNotation)IPAddress(InetAddress inetAddress)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(IPAddress o)IPAddressdecr()decrbooleanequals(Object obj)static intfromBytes(byte b1, byte b2, byte b3, byte b4)Returns theintvalue whose byte representation is the given 4 bytes, in big-endian order; equivalent toInts.fromByteArray(new byte[] {b1, b2, b3, b4}).inthashCode()IPAddressincr()incrbooleanisGreaterThan(IPAddress other)isGreaterThanbooleanisGreaterThanOrEqualTo(IPAddress other)isGreaterThanOrEqualTobooleanisLessThan(IPAddress other)isLessThanbooleanisLessThanOrEqualTo(IPAddress other)isLessThanOrEqualTobooleanisPredecessorOf(IPAddress other)isPredecessorOfbooleanisSuccessorOf(IPAddress other)isSuccessorOfstatic IPAddressmax(IPAddress a, IPAddress b)maxstatic IPAddressmin(IPAddress a, IPAddress b)BigIntegertoBigInteger()StringtoDbString()InetAddresstoInetAddress()protected byte[]toIpAddrBytes(String dottedNotation)protected StringtoIpAddrString(byte[] addr)protected StringtoIpAddrString(InetAddress addr)byte[]toOctets()StringtoString()StringtoUserString()
-
-
-
Field Detail
-
m_inetAddress
protected final InetAddress m_inetAddress
-
-
Constructor Detail
-
IPAddress
public IPAddress(String dottedNotation)
-
IPAddress
public IPAddress(InetAddress inetAddress)
-
IPAddress
public IPAddress(byte[] ipAddrOctets)
-
-
Method Detail
-
toInetAddress
public InetAddress toInetAddress()
-
toOctets
public byte[] toOctets()
-
compareTo
public int compareTo(IPAddress o)
- Specified by:
compareToin interfaceComparable<IPAddress>
-
toUserString
public String toUserString()
-
toDbString
public String toDbString()
-
toBigInteger
public BigInteger toBigInteger()
-
isPredecessorOf
public boolean isPredecessorOf(IPAddress other)
isPredecessorOf
- Parameters:
other- aIPAddressobject.- Returns:
- a boolean.
-
isSuccessorOf
public boolean isSuccessorOf(IPAddress other)
isSuccessorOf
- Parameters:
other- aIPAddressobject.- Returns:
- a boolean.
-
isLessThan
public boolean isLessThan(IPAddress other)
isLessThan
- Parameters:
other- aIPAddressobject.- Returns:
- a boolean.
-
isLessThanOrEqualTo
public boolean isLessThanOrEqualTo(IPAddress other)
isLessThanOrEqualTo
- Parameters:
other- aIPAddressobject.- Returns:
- a boolean.
-
isGreaterThan
public boolean isGreaterThan(IPAddress other)
isGreaterThan
- Parameters:
other- aIPAddressobject.- Returns:
- a boolean.
-
isGreaterThanOrEqualTo
public boolean isGreaterThanOrEqualTo(IPAddress other)
isGreaterThanOrEqualTo
- Parameters:
other- aIPAddressobject.- Returns:
- a boolean.
-
toIpAddrString
protected String toIpAddrString(InetAddress addr)
-
toIpAddrString
protected String toIpAddrString(byte[] addr)
-
toIpAddrBytes
protected byte[] toIpAddrBytes(String dottedNotation)
-
fromBytes
public static int fromBytes(byte b1, byte b2, byte b3, byte b4)Returns theintvalue whose byte representation is the given 4 bytes, in big-endian order; equivalent toInts.fromByteArray(new byte[] {b1, b2, b3, b4}).From: Guava.
-
-