Class RgxGenOption<T>

java.lang.Object
com.github.curiousoddman.rgxgen.config.RgxGenOption<T>

public class RgxGenOption<T> extends Object
Enum of keys for available configuration options.
  • Field Details

    • INFINITE_PATTERN_REPETITION

      public static final RgxGenOption<Integer> INFINITE_PATTERN_REPETITION
      For infinite patterns, such as a+, a* and a{n,}, defines limit for the repetitions.
      Default Value:
      100
    • CASE_INSENSITIVE

      public static final RgxGenOption<Boolean> CASE_INSENSITIVE
      Flag to use case-insensitive matching.
      Default Value:
      false
    • DOT_MATCHES_ONLY

      public static final RgxGenOption<RgxGenCharsDefinition> DOT_MATCHES_ONLY
      Choose which characters dot pattern could generate.
      Default Value:
      null
    • WHITESPACE_DEFINITION

      public static final RgxGenOption<List<WhitespaceChar>> WHITESPACE_DEFINITION
      Choose which characters \s pattern could generate.
      Default Value:
      SPACE, TAB
  • Constructor Details

    • RgxGenOption

      public RgxGenOption(String key, T defaultValue)
      Create an option with specific key and default value
      Parameters:
      key - unique identifier of the option
      defaultValue - default value
  • Method Details

    • getKey

      public String getKey()
      Get unique identifier of the property
      Returns:
      unique key
    • getDefault

      public T getDefault()
      Get default value associated with the option
      Returns:
      default value
    • getFromProperties

      public T getFromProperties(RgxGenProperties properties)
      Get value from the properties object.
      Parameters:
      properties - object to get value from
      Returns:
      value from properties, if present. Default otherwise.
    • setInProperties

      public void setInProperties(RgxGenProperties properties, T value)
      Associates value for this option in the properties
      Parameters:
      properties - properties to add to
      value - a value
    • toString

      public String toString()
      Overrides:
      toString in class Object