code: private Optional<Pattern> getDefaultValidationPattern(Class javaType) {
          return javaType.isEnum() ?
                  Optional.of(createValidationPatternFromEnumType(javaType)) :
                  getDefaultPatternIfPrimitive(javaType);
      }
docs: Try to create a sensible default for validation pattern, in the case where the java type
  of the parameter is an enum type or a primitive or primitive wrapper type
  @param javaType
  @return