Lines Matching refs:reference
28 * Ensures that an object reference passed as a parameter to the calling
31 * @param reference an object reference
32 * @return the non-null reference that was validated
33 * @throws NullPointerException if {@code reference} is null
35 public static <T> T checkNotNull(final T reference) {
36 if (reference == null) {
39 return reference;
43 * Ensures that an object reference passed as a parameter to the calling
46 * @param reference an object reference
49 * @return the non-null reference that was validated
50 * @throws NullPointerException if {@code reference} is null
52 public static <T> T checkNotNull(final T reference, final Object errorMessage) {
53 if (reference == null) {
56 return reference;