@ NullSafe @ SuppressWarnings ( { "unchecked" , "varargs" } ) public static < T > T defaultIfNull ( T ... values ) { for ( T value : nullSafeArray ( values ) ) { if ( value != null ) { return value ; } } return null ; }
Gets the first non - null value in the array of values .