Tabnine Logo
ConfigPropertyUtils.createValidationPatternFromEnumType
Code IndexAdd Tabnine to your IDE (free)

How to use
createValidationPatternFromEnumType
method
in
org.chorusbdd.chorus.handlerconfig.configproperty.ConfigPropertyUtils

Best Java code snippets using org.chorusbdd.chorus.handlerconfig.configproperty.ConfigPropertyUtils.createValidationPatternFromEnumType (Showing top 3 results out of 315)

origin: Chorus-bdd/Chorus

/**
 * 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
 */
private Optional<Pattern> getDefaultValidationPattern(Class javaType) {
  return javaType.isEnum() ?
      Optional.of(createValidationPatternFromEnumType(javaType)) :
      getDefaultPatternIfPrimitive(javaType);
}
origin: Chorus-bdd/Chorus

@Test
public void testEnumWithPermittedCharacters() {
  Pattern actual = ConfigPropertyUtils.createValidationPatternFromEnumType(Scope.class);
  assertEquals("(?i)SCENARIO|FEATURE", actual.pattern());
}
origin: Chorus-bdd/Chorus

@Test
public void testEnumWithBadCharacters() {
  Pattern actual = ConfigPropertyUtils.createValidationPatternFromEnumType(BadBadEnum.class);
  assertEquals("(?i)This_Enum_Val_Cointains_Really_\\$_BAD_CHARS_£", actual.pattern());
  assertTrue(actual.matcher(BadBadEnum.This_Enum_Val_Cointains_Really_$_BAD_CHARS_£.name()).matches());
}
org.chorusbdd.chorus.handlerconfig.configpropertyConfigPropertyUtilscreateValidationPatternFromEnumType

Javadoc

Create a regular expression which will match any of the values from the supplied enum type

Popular methods of ConfigPropertyUtils

  • checkNotNullAndNotEmpty

Popular in Java

  • Updating database using SQL prepared statement
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getExternalFilesDir (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • Collectors (java.util.stream)
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now