Top Constructors Methods
org.hibernate.internal.util

public Class NullnessHelper

extends Object
Class Inheritance
Imports
java.util.function.Supplier

Author
Steve Ebersole

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static <
Generic type of values to coalesce
T
>
T

Returns:

The first non-empty value, or null if all values were empty
coalesce
(T...
The list of values.
values
)

Operates like SQL coalesce expression, except empty strings are treated as null.

public static <T> T
coalesceSuppliedValues(Supplier<T>... valueSuppliers)

Find the first non-null value supplied by the given suppliers

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

NullnessHelperback to summary
public NullnessHelper()

Method Detail

coalesceback to summary
public static <T> T coalesce(T... values)

Operates like SQL coalesce expression, except empty strings are treated as null. Return the first non-empty value

Parameters
<T>
Generic type of values to coalesce
values:T[]

The list of values.

Returns:T

The first non-empty value, or null if all values were empty

coalesceSuppliedValuesback to summary
public static <T> T coalesceSuppliedValues(Supplier<T>... valueSuppliers)

Find the first non-null value supplied by the given suppliers