code: public static String[] getDefaultWhiteList(Field field) {
          Method values = null;
  
          if (!field.getType().isEnum()) {
              try {
                  values = field.getType().getMethod("values");
              } catch (NoSuchMethodException e) {
                  log.info("field : " + field.getName() + " values method not found ");
              }
  
              try {
                  Object[] objs = (Object[]) values.invoke(field.getType());
                  return (String[]) Arrays.stream(objs).map(obj -> String.valueOf(obj)).toArray();
              } catch (IllegalAccessException | InvocationTargetException e) {
                  log.info("values invoke error : " + e.getMessage());
              }
          }
          return null;
      }
docs: Get default white list string [ ].
  
  @param field the field
  @return the string [ ]