Objects

public final class Objects extends Object

Helper functions for Objects.

Methods

nonNull

public static boolean nonNull(Object obj)

Returnstrueif the provided reference is non-nullotherwise returnsfalse.

Parameters

Name Description
Object obj

a reference to be checked against null

ReturnValue

Name Description
boolean

true if the provided reference is non-null otherwise false

checkNotNull

public static <T>T checkNotNull(T reference)

Ensures that an object reference passed as a parameter to the calling method is not null.

Parameters

Name Description
T reference

an object reference

ReturnValue

Name Description
T

the non-null reference that was validated