public static boolean isClassNameValid(String className) {
    if (StringUtils.isBlank(className)) {
      return false;
    }
    String regex = "([\\p{L}_$][\\p{L}\\p{N}_$]*\\.)*[\\p{L}_$][\\p{L}\\p{N}_$]*";
    return Pattern.matches(regex, className);
  }
this provides a convenient method to validate if the given name is a valid classname

@param className the class name to be validated
@return false if classname is blank or has invalid classname characters
geode-management/src/main/java/org/apache/geode/management/configuration/ClassName.java