public static boolean containsOnlyDigits(String text) {
        if (isEmpty(text)) {
            return false;
        }
        for (int i = 0; i < text.length(); i++) {
            if (!Character.isDigit(text.charAt(i))) {
                return false;
            }
        }
        return true;
    }
public static boolean containsOnlyDigits ( String text ) { if ( isEmpty ( text ) ) { return false ; } for ( int i = 0 ; i < text . length ( ) ; i ++ ) { if ( ! Character . isDigit ( text . charAt ( i ) ) ) { return false ; } } return true ; }
@param text
@return <code>true</code> if the given text contains only digits