io.github.erictsangx:kotlin-random

A very simple lib of Java Random and Kotlin aims to make testing easier, no magic.

License

License

Categories

Categories

Kotlin Languages
GroupId

GroupId

io.github.erictsangx
ArtifactId

ArtifactId

kotlin-random
Last Version

Last Version

0.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

io.github.erictsangx:kotlin-random
A very simple lib of Java Random and Kotlin aims to make testing easier, no magic.
Project URL

Project URL

https://github.com/erictsangx/kotlin-random
Source Code Management

Source Code Management

https://github.com/erictsangx/kotlin-random

Download kotlin-random

How to add to project

<!-- https://jarcasting.com/artifacts/io.github.erictsangx/kotlin-random/ -->
<dependency>
    <groupId>io.github.erictsangx</groupId>
    <artifactId>kotlin-random</artifactId>
    <version>0.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/io.github.erictsangx/kotlin-random/
implementation 'io.github.erictsangx:kotlin-random:0.0.1'
// https://jarcasting.com/artifacts/io.github.erictsangx/kotlin-random/
implementation ("io.github.erictsangx:kotlin-random:0.0.1")
'io.github.erictsangx:kotlin-random:jar:0.0.1'
<dependency org="io.github.erictsangx" name="kotlin-random" rev="0.0.1">
  <artifact name="kotlin-random" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.github.erictsangx', module='kotlin-random', version='0.0.1')
)
libraryDependencies += "io.github.erictsangx" % "kotlin-random" % "0.0.1"
[io.github.erictsangx/kotlin-random "0.0.1"]

Dependencies

compile (1)

Group / Artifact Type Version
org.jetbrains.kotlin : kotlin-stdlib-jre8 jar 1.1.1

test (3)

Group / Artifact Type Version
org.junit.jupiter : junit-jupiter-api jar 5.0.0-M3
org.jetbrains.kotlin : kotlin-test jar 1.1.1
org.junit.jupiter : junit-jupiter-engine jar 5.0.0-M3

Project Modules

There are no modules declared in this project.

kotlin-random

A very simple lib of Java Random and Kotlin aims to make testing easier, no magic. Also support Java8 OffsetTime, OffsetDateTime and Instant

Gradle

compile "io.github.erictsangx:kotlin-random:0.0.1"

Maven

<dependency>
  <groupId>io.github.erictsangx</groupId>
  <artifactId>kotlin-random</artifactId>
  <version>0.0.1</version>
</dependency>

Examples:

val a = Rand.int  // 1-100 by default
val b = Rand.str  // 3feffb92c82745a3b6ccd5f9fec5e3f1
val c = Rand.bool // same as Random().nextBoolean()

val timeA = Rand.time // 15:52:23.130+08:00
val dataA = Rand.nDate //[OffsetDateTime.now] - [1,7] days - [Rand.time]
val dataB = Rand.pDate //[OffsetDateTime.now] + [1,7] days + [Rand.time]

Extensions

class Foo(name: String, age: Int)

val Rand.foo: Foo
    get() = Foo(str, int)

Versions

Version
0.0.1