Top Description Inners Fields Constructors Methods
io.reactivex.internal.functions

public final Class ObjectHelper

extends Object
Class Inheritance
Imports
io.reactivex.functions.BiPredicate

Utility methods containing the backport of Java 7's Objects utility class.

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

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class

Field Summary

Modifier and TypeField and Description
pack-priv static final BiPredicate<Object, Object>

Constructor Summary

AccessConstructor and Description
private
ObjectHelper()

Utility class.

Method Summary

Modifier and TypeMethod and Description
public static int

Returns:

the comparison result
compare
(int
the first value
v1
,
int
the second value
v2
)

Compares two integer values similar to Integer.compare.

public static int

Returns:

the comparison result
compare
(long
the first value
v1
,
long
the second value
v2
)

Compares two long values similar to Long.compare.

public static boolean

Returns:

the comparison result
equals
(Object
the first object
o1
,
Object
the second object
o2
)

Compares two potentially null objects with each other using Object.equals.

public static <
the value type
T
>
BiPredicate<T, T>

Returns:

the bi-predicate instance
equalsPredicate
()

Returns a BiPredicate that compares its parameters via Objects.equals().

public static int

Returns:

the hashCode
hashCode
(Object
the object to get the hashCode for.
o
)

Returns the hashCode of a non-null object or zero for a null object.

public static <
the value type
T
>
T

Returns:

the object itself
requireNonNull
(T
the object to verify
object
,
String
the message to use with the NullPointerException
message
)

Verifies if the object is not null and returns it or throws a NullPointerException with the given message.

public static long

Returns:

the value
requireNonNull
(long
the value to check
value
,
String
the message to print
message
)

Deprecated this method should not be used as there is no need to check primitives for nullness.
Trap null-check attempts on primitives.
public static int

Returns:

value
verifyPositive
(int
the value to validate
value
,
String
the parameter name of the value
paramName
)

Validate that the given value is positive or report an IllegalArgumentException with the parameter name.

public static long

Returns:

value
verifyPositive
(long
the value to validate
value
,
String
the parameter name of the value
paramName
)

Validate that the given value is positive or report an IllegalArgumentException with the parameter name.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

EQUALSback to summary
pack-priv static final BiPredicate<Object, Object> EQUALS

Constructor Detail

ObjectHelperback to summary
private ObjectHelper()

Utility class.

Method Detail

compareback to summary
public static int compare(int v1, int v2)

Compares two integer values similar to Integer.compare.

Parameters
v1:int

the first value

v2:int

the second value

Returns:int

the comparison result

compareback to summary
public static int compare(long v1, long v2)

Compares two long values similar to Long.compare.

Parameters
v1:long

the first value

v2:long

the second value

Returns:int

the comparison result

equalsback to summary
public static boolean equals(Object o1, Object o2)

Compares two potentially null objects with each other using Object.equals.

Parameters
o1:Object

the first object

o2:Object

the second object

Returns:boolean

the comparison result

equalsPredicateback to summary
public static <T> BiPredicate<T, T> equalsPredicate()

Returns a BiPredicate that compares its parameters via Objects.equals().

Parameters
<T>
the value type
Returns:BiPredicate<T, T>

the bi-predicate instance

Annotations
@SuppressWarnings:unchecked
hashCodeback to summary
public static int hashCode(Object o)

Returns the hashCode of a non-null object or zero for a null object.

Parameters
o:Object

the object to get the hashCode for.

Returns:int

the hashCode

requireNonNullback to summary
public static <T> T requireNonNull(T object, String message)

Verifies if the object is not null and returns it or throws a NullPointerException with the given message.

Parameters
<T>
the value type
object:T

the object to verify

message:String

the message to use with the NullPointerException

Returns:T

the object itself

Exceptions
NullPointerException:
if object is null
requireNonNullback to summary
public static long requireNonNull(long value, String message)

Deprecated

this method should not be used as there is no need to check primitives for nullness.

Trap null-check attempts on primitives.

Parameters
value:long

the value to check

message:String

the message to print

Returns:long

the value

Annotations
@Deprecated
verifyPositiveback to summary
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:int

the value to validate

paramName:String

the parameter name of the value

Returns:int

value

Exceptions
IllegalArgumentException:
if bufferSize <= 0
verifyPositiveback to summary
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:long

the value to validate

paramName:String

the parameter name of the value

Returns:long

value

Exceptions
IllegalArgumentException:
if bufferSize <= 0
io.reactivex.internal.functions back to summary

pack-priv final Class ObjectHelper.BiObjectPredicate

extends Object
implements BiPredicate<Object, Object>
Class Inheritance
  • java.lang.Object
  • io.reactivex.internal.functions.ObjectHelper.BiObjectPredicate
All Implemented Interfaces
io.reactivex.functions.BiPredicate

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public boolean
test(Object
the first value
o1
,
Object
the second value
o2
)

Implements io.reactivex.functions.BiPredicate.test.

Test the given input values and return a boolean.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

BiObjectPredicateback to summary
pack-priv BiObjectPredicate()

Method Detail

testback to summary
public boolean test(Object o1, Object o2)

Implements io.reactivex.functions.BiPredicate.test.

Doc from io.reactivex.functions.BiPredicate.test.

Test the given input values and return a boolean.

Parameters
o1:Object

the first value

o2:Object

the second value

Returns:boolean

the boolean result

Annotations
@Override