Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kotlin top-level functions for quickly generating values #3

Open
maxpilotto opened this issue Jun 4, 2021 · 0 comments
Open

Kotlin top-level functions for quickly generating values #3

maxpilotto opened this issue Jun 4, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@maxpilotto
Copy link
Owner

The KRandProcessor should generate a file containing 3 top-level functions for each generator, these are supposed to be used for quickly generating values without the same level of configuration the generator offers

// Generators.kt

fun integer(
    min: Int,
    max: Int,
    seed: Any? = null
) = IntegerGenerator(seed).min(min).max(max).one()

fun integerString(
    min: Int,
    max: Int,
    seed: Any? = null
) = IntegerGenerator(seed).min(min).max(max).string()

fun integer(
    min: Int,
    max: Int,
    count: Int,
    seed: Any? = null
) = IntegerGenerator(seed).min(min).max(max).many(count)
@maxpilotto maxpilotto added the enhancement New feature or request label Jun 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant