Make ObjectUtils.defaultIfNull generic
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1002368 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
5b25355eb9
commit
d263c80808
|
@ -92,7 +92,7 @@ public class ObjectUtils {
|
|||
* @param defaultValue the default value to return, may be <code>null</code>
|
||||
* @return <code>object</code> if it is not <code>null</code>, defaultValue otherwise
|
||||
*/
|
||||
public static Object defaultIfNull(Object object, Object defaultValue) {
|
||||
public static <T> T defaultIfNull(T object, T defaultValue) {
|
||||
return object != null ? object : defaultValue;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue