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:
Matthew Jason Benson 2010-09-28 21:52:32 +00:00
parent 5b25355eb9
commit d263c80808
1 changed files with 1 additions and 1 deletions

View File

@ -92,7 +92,7 @@ public ObjectUtils() {
* @param defaultValue the default value to return, may be <code>null</code> * @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 * @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; return object != null ? object : defaultValue;
} }