public static void checkNotNullOrEmpty ( String input , String errorMessage ) { try { Preconditions . checkArgument ( StringUtils . isNotBlank ( input ) , errorMessage ) ; } catch ( IllegalArgumentException exception ) { throw new ApplicationException ( ApplicationException . Code . INVALID_INPUT , errorMessage ) ; } }
This method checks it the input string is null or empty .