package Ġdev . fork handles . fab rik ate Ċ Ċ import Ġjava . io . File Ċ import Ġjava . math . BigDecimal Ċ import Ġjava . math . BigInteger Ċ import Ġjava . net . URI Ċ import Ġjava . net . URL Ċ import Ġjava . time . Duration Ċ import Ġjava . time . Instant Ċ import Ġjava . time . LocalDate Ċ import Ġjava . time . LocalDateTime Ċ import Ġjava . time . Local Time Ċ import Ġjava . time . Offset DateTime Ċ import Ġjava . time . Offset Time Ċ import Ġjava . time . Zone Offset . UTC Ċ import Ġjava . time . Z onedDateTime Ċ import Ġjava . util .* Ċ import Ġkotlin . random . Random Ċ import Ġkotlin . random . as Java Random Ċ Ċ type alias ĠFabric ator < T > Ġ= Ġ() Ġ-> ĠT Ċ Ċ class ĠLong Fabric ator ( private Ġval Ġrandom : ĠRandom Ġ= ĠRandom ) Ġ: ĠFabric ator < Long > Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġinvoke () Ġ= Ġrandom . next Long () Ċ } Ċ Ċ class ĠInt Fabric ator ( private Ġval Ġrandom : ĠRandom Ġ= ĠRandom ) Ġ: ĠFabric ator < Int > Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġinvoke () Ġ= Ġrandom . nextInt () Ċ } Ċ Ċ class ĠDouble Fabric ator ( private Ġval Ġrandom : ĠRandom Ġ= ĠRandom ) Ġ: ĠFabric ator < Double > Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġinvoke () Ġ= Ġrandom . next Double () Ċ } Ċ Ċ class ĠFloat Fabric ator ( private Ġval Ġrandom : ĠRandom Ġ= ĠRandom ) Ġ: ĠFabric ator < Float > Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġinvoke () Ġ= Ġrandom . next Float () Ċ } Ċ Ċ class ĠBigDecimal Fabric ator ( ĊĠĠĠ Ġprivate Ġval Ġsize : ĠInt Ġ= Ġ 1 0 , ĊĠĠĠ Ġprivate Ġval Ġrandom : ĠRandom Ġ= ĠRandom Ċ ) Ġ: ĠFabric ator < BigDecimal > Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġinvoke () Ġ= ĠBigInteger ( size , Ġrandom . as Java Random ()). to BigDecimal () Ċ } Ċ Ċ class ĠBigInteger Fabric ator ( ĊĠĠĠ Ġprivate Ġval Ġsize : ĠInt Ġ= Ġ 1 0 , ĊĠĠĠ Ġprivate Ġval Ġrandom : ĠRandom Ġ= ĠRandom Ċ ) Ġ: ĠFabric ator < BigInteger > Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġinvoke () Ġ= ĠBigInteger ( size , Ġrandom . as Java Random ()) Ċ } Ċ Ċ class ĠString Fabric ator ( ĊĠĠĠ Ġprivate Ġval Ġlength : ĠInt Range Ġ= ĠInt Range ( 1 , Ġ 1 0 ), ĊĠĠĠ Ġprivate Ġval Ġchar Pool : ĠList < Char > Ġ= Ġ(' a ' .. ' z ') Ġ+ Ġ(' A ' .. ' Z ') Ġ+ Ġ(' 0 ' .. ' 9 '), ĊĠĠĠ Ġprivate Ġval Ġrandom : ĠRandom Ġ= ĠRandom , Ċ ) Ġ: ĠFabric ator < String > Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġinvoke () Ġ= Ġ( 1 .. random . nextInt ( length . first , Ġlength . last Ġ+ Ġ 1 )) ĊĠĠĠĠĠĠĠ Ġ. map Ġ{ Ġchar Pool . random ( random ) Ġ} ĊĠĠĠĠĠĠĠ Ġ. join ToString ("") Ċ } Ċ Ċ class ĠChar Fabric ator ( ĊĠĠĠ Ġprivate Ġval Ġchar Pool : ĠChar Range Ġ= Ġ(' A ' .. ' z '), ĊĠĠĠ Ġprivate Ġval Ġrandom : ĠRandom Ġ= ĠRandom Ċ ) Ġ: ĠFabric ator < Char > Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġinvoke (): ĠChar Ġ= Ġchar Pool . random ( random ) Ċ } Ċ Ċ class ĠBytes Fabric ator ( ĊĠĠĠ Ġprivate Ġval Ġsize : ĠInt Ġ= Ġ 1 0 , ĊĠĠĠ Ġprivate Ġval Ġrandom : ĠRandom Ġ= ĠRandom , Ċ ) Ġ: ĠFabric ator < ByteArray > Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġinvoke () Ġ= Ġrandom . next Bytes ( size ) Ċ } Ċ Ċ class ĠInstant Fabric ator ( private Ġval Ġrandom : ĠRandom Ġ= ĠRandom ) Ġ: ĠFabric ator < Instant > Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġinvoke (): ĠInstant Ġ= ĠInstant . of Epoch Second ( random . next Long ( 0 , Ġ 1 7 3 5 6 8 9 6 0 0 )) Ċ } Ċ Ċ class ĠLocalDate Fabric ator ( private Ġval Ġrandom : ĠRandom Ġ= ĠRandom ) Ġ: ĠFabric ator < LocalDate > Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġinvoke (): ĠLocalDate Ġ= ĠLocalDate . of Instant ( Instant Fabric ator ( random ) (), ĠUTC ) Ċ } Ċ Ċ class ĠLocal Time Fabric ator ( private Ġval Ġrandom : ĠRandom Ġ= ĠRandom ) Ġ: ĠFabric ator < Local Time > Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġinvoke (): ĠLocal Time Ġ= ĠLocal Time . of Instant ( Instant Fabric ator ( random ) (), ĠUTC ) Ċ } Ċ Ċ class ĠLocalDateTime Fabric ator ( private Ġval Ġrandom : ĠRandom Ġ= ĠRandom ) Ġ: ĠFabric ator < LocalDateTime > Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġinvoke (): ĠLocalDateTime Ġ= ĠLocalDateTime . of Instant ( Instant Fabric ator ( random ) (), ĠUTC ) Ċ } Ċ Ċ class ĠOffset DateTime Fabric ator ( private Ġval Ġrandom : ĠRandom Ġ= ĠRandom ) Ġ: ĠFabric ator < Offset DateTime > Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġinvoke (): ĠOffset DateTime Ġ= ĠOffset DateTime . of Instant ( Instant Fabric ator ( random ) (), ĠUTC ) Ċ } Ċ Ċ class ĠOffset Time Fabric ator ( private Ġval Ġrandom : ĠRandom Ġ= ĠRandom ) Ġ: ĠFabric ator < Offset Time > Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġinvoke (): ĠOffset Time Ġ= ĠOffset Time . of Instant ( Instant Fabric ator ( random ) (), ĠUTC ) Ċ } Ċ Ċ class ĠZ onedDateTime Fabric ator ( private Ġval Ġrandom : ĠRandom Ġ= ĠRandom ) Ġ: ĠFabric ator < Z onedDateTime > Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġinvoke (): ĠZ onedDateTime Ġ= ĠZ onedDateTime . of Instant ( Instant Fabric ator ( random ) (), ĠUTC ) Ċ } Ċ Ċ class ĠDate Fabric ator ( private Ġval Ġrandom : ĠRandom Ġ= ĠRandom ) Ġ: ĠFabric ator < Date > Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġinvoke (): ĠDate Ġ= ĠDate . from ( Instant Fabric ator ( random ) ()) Ċ } Ċ Ċ class ĠDuration Fabric ator ( private Ġval Ġrandom : ĠRandom Ġ= ĠRandom ) Ġ: ĠFabric ator < Duration > Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġinvoke (): ĠDuration Ġ= ĠDuration . of Days ( random . next Long ( 1 , Ġ 1 0 )) Ċ } Ċ Ċ class ĠUUID Fabric ator Ġ: ĠFabric ator < UUID > Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġinvoke (): ĠUUID Ġ= ĠUUID . randomUUID () Ċ } Ċ Ċ class ĠUri Fabric ator ( private Ġval Ġrandom : ĠRandom Ġ= ĠRandom ) Ġ: ĠFabric ator < URI > Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġinvoke (): ĠURI Ġ= ĠURI . create (" https ://${ String Fabric ator ( random Ġ= Ġrandom ) ()}. com ") Ċ } Ċ Ċ class ĠUrl Fabric ator ( private Ġval Ġrandom : ĠRandom Ġ= ĠRandom ) Ġ: ĠFabric ator < URL > Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġinvoke (): ĠURL Ġ= ĠURL (" https ://${ String Fabric ator ( random Ġ= Ġrandom ) ()}. com ") Ċ } Ċ Ċ class ĠFile Fabric ator Ġ: ĠFabric ator < File > Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġinvoke (): ĠFile Ġ= ĠFile . create TempFile (" fab rik ate ", Ġnull ). apply Ġ{ Ġdelete On Exit () Ġ} Ċ } Ċ Ċ class ĠAny Fabric ator ( private Ġval Ġany : ĠAny Ġ= Ġ" anything ") Ġ: ĠFabric ator < Any > Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġinvoke (): ĠAny Ġ= Ġany Ċ } Ċ