[java] How to check if a string contains only digits in Java