util: (minor) Add proper @Contract to ObjectUtils.tryCast()

This commit is contained in:
Eldar Abusalimov
2017-05-04 19:14:50 +03:00
parent 0d5562570d
commit 2c4303606e
@@ -79,7 +79,7 @@ public class ObjectUtils {
return value == null ? defaultValue : value;
}
@Nullable
@Contract("null, _ -> null")
public static <T> T tryCast(@Nullable Object obj, @NotNull Class<T> clazz) {
if (clazz.isInstance(obj)) {
return clazz.cast(obj);