Package org.apache.commons.io.function
Interface IOComparator<T>
-
- Type Parameters:
T
- the type of objects that may be compared by this comparator
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface IOComparator<T>
LikeComparator
but throwsIOException
.- Since:
- 2.12.0
- See Also:
Comparator
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default java.util.Comparator<T>
asComparator()
Creates aComparator
for this instance that throwsUncheckedIOException
instead ofIOException
.int
compare(T o1, T o2)
LikeComparator.compare(Object, Object)
but throwsIOException
.
-
-
-
Method Detail
-
asComparator
default java.util.Comparator<T> asComparator()
Creates aComparator
for this instance that throwsUncheckedIOException
instead ofIOException
.- Returns:
- an UncheckedIOException BiFunction.
-
compare
int compare(T o1, T o2) throws java.io.IOException
LikeComparator.compare(Object, Object)
but throwsIOException
.- Parameters:
o1
- the first object to be compared.o2
- the second object to be compared.- Returns:
- a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.
- Throws:
java.lang.NullPointerException
- if an argument is null and this comparator does not permit null argumentsjava.lang.ClassCastException
- if the arguments' types prevent them from being compared by this comparator.java.io.IOException
- if an I/O error occurs.
-
-