Class ObjectHelper

java.lang.Object
io.reactivex.rxjava3.internal.functions.ObjectHelper

public final class ObjectHelper extends Object
Utility methods containing the backport of Java 7's Objects utility class.

Named as such to avoid clash with java.util.Objects.

  • Field Details

  • Constructor Details

    • ObjectHelper

      private ObjectHelper()
      Utility class.
  • Method Details

    • 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, String paramName)
      Validate that the given value is positive or report an IllegalArgumentException with the parameter name.
      Parameters:
      value - the value to validate
      paramName - the parameter name of the value
      Returns:
      value
      Throws:
      IllegalArgumentException - if bufferSize <= 0
    • verifyPositive

      public static long verifyPositive(long value, String paramName)
      Validate that the given value is positive or report an IllegalArgumentException with the parameter name.
      Parameters:
      value - the value to validate
      paramName - the parameter name of the value
      Returns:
      value
      Throws:
      IllegalArgumentException - if bufferSize <= 0