public static String requireNotEmpty ( final String str ) throws NullPointerException , IllegalArgumentException { if ( str . length ( ) == 0 ) { throw new IllegalArgumentException ( ) ; } return str ; }
Ensures the String is not null or empty .