public class Contract extends Object
public static <T> T asNotNull(T input, String message)
PENDING: type of exception? there are raging debates, some favour an IllegalArgument?
PENDING: the implementation uses a unchecked type cast to an array. can we do better, how?
T
- the type of the input parameterinput
- the argument to check against null.message
- the text of the exception if the argument is nullNullPointerException
- if input is nullCopyright © 2014. All rights reserved.