Package org.opennms.core.utils
Class ByteArrayComparator
- java.lang.Object
-
- org.opennms.core.utils.ByteArrayComparator
-
- All Implemented Interfaces:
Comparator<byte[]>
public class ByteArrayComparator extends Object implements Comparator<byte[]>
Comparator that is used to compare byte arrays. This should be used to compare IP addresses usingInetAddress.getAddress()
and can be used to compare any pair of IPv4 and/or IPv6 addresses.- Author:
- Seth <seth@opennms.org>
-
-
Constructor Summary
Constructors Constructor Description ByteArrayComparator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(byte[] a, byte[] b)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
-
-
-
Method Detail
-
compare
public int compare(byte[] a, byte[] b)
- Specified by:
compare
in interfaceComparator<byte[]>
-
-