Class ObjectHelper
- java.lang.Object
-
- io.reactivex.rxjava3.internal.functions.ObjectHelper
-
public final class ObjectHelper extends java.lang.ObjectUtility methods containing the backport of Java 7's Objects utility class.Named as such to avoid clash with java.util.Objects.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classObjectHelper.BiObjectPredicate
-
Field Summary
Fields Modifier and Type Field Description (package private) static BiPredicate<java.lang.Object,java.lang.Object>EQUALS
-
Constructor Summary
Constructors Modifier Constructor Description privateObjectHelper()Utility class.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> BiPredicate<T,T>equalsPredicate()Returns a BiPredicate that compares its parameters via Objects.equals().static intverifyPositive(int value, java.lang.String paramName)Validate that the given value is positive or report an IllegalArgumentException with the parameter name.static longverifyPositive(long value, java.lang.String paramName)Validate that the given value is positive or report an IllegalArgumentException with the parameter name.
-
-
-
Field Detail
-
EQUALS
static final BiPredicate<java.lang.Object,java.lang.Object> EQUALS
-
-
Method Detail
-
equalsPredicate
public static <T> BiPredicate<T,T> equalsPredicate()
Returns a BiPredicate that compares its parameters via Objects.equals().- Type Parameters:
T- the value type- Returns:
- the bi-predicate instance
-
verifyPositive
public static int verifyPositive(int value, java.lang.String paramName)Validate that the given value is positive or report an IllegalArgumentException with the parameter name.- Parameters:
value- the value to validateparamName- the parameter name of the value- Returns:
- value
- Throws:
java.lang.IllegalArgumentException- if bufferSize <= 0
-
verifyPositive
public static long verifyPositive(long value, java.lang.String paramName)Validate that the given value is positive or report an IllegalArgumentException with the parameter name.- Parameters:
value- the value to validateparamName- the parameter name of the value- Returns:
- value
- Throws:
java.lang.IllegalArgumentException- if bufferSize <= 0
-
-