/** * The templatized version of the call.. to avoid downcast all the time! * * @param o * @return the object itself after checking that it is defined * @throws MissingConfigParameterException if it is not defined */ public static <T> T getRequired(final T o) throws MissingConfigParameterException { if (o == null) { throw new MissingConfigParameterException("required Object has not been defined"); } return o; } }
/** * Given an object object, checks if it is defined. If not throws an exception. * If yes returns the value. * * @param o * @return the object itself after checking that it is defined * @throws MissingConfigParameterException if it is not defined */ public static Object getRequiredObject(final Object o) throws MissingConfigParameterException { if (o == null) { throw new MissingConfigParameterException("required Object has not been defined"); } return o; }
/** * Given an object object, checks if it is defined. If not throws an exception. * If yes returns the value. * * @param o * @return the object itself after checking that it is defined * @throws MissingConfigParameterException if it is not defined */ public static Object getRequiredObject(final Object o) throws MissingConfigParameterException { if (o == null) { throw new MissingConfigParameterException("required Object has not been defined"); } return o; }
/** * The templatized version of the call.. to avoid downcast all the time! * * @param o * @return the object itself after checking that it is defined * @throws MissingConfigParameterException if it is not defined */ public static <T> T getRequired(final T o) throws MissingConfigParameterException { if (o == null) { throw new MissingConfigParameterException("required Object has not been defined"); } return o; } }