Skip to content

Latest commit

History

24 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

dynamic

BuildMaven Central

A Scala library that allows copying a case class using a dynamic property name.

Getting started

dynamic is available for the JVM Runtime using Scala 2.12, 2.13.

Add as a dependency:

libraryDependencies +="io.github.reugn"%%"dynamic"% version

Build from source:

sbt clean +package

Usage example

caseclassFoo(i: Int, s: String)
caseclassBar(f: Foo, b: Boolean)
caseclassBaz(b: Bar, i1: Int, i2: Int, s2: String)
importio.github.reugn.dynamic.copyvalfoo=Foo(1, "str")
valbar=Bar(foo, b =false)
valbaz=Baz(bar, 4, 5, "str2")
valnew_bar=Bar(Foo(10, "str10"), b =true)
valcopied_baz= copy(baz, "b", new_bar)
copied_baz.b shouldBe new_bar

License

Licensed under the Apache 2.0 License.

About

A Scala library that allows copying a case class using a dynamic property name

Topics

Resources

Stars

11 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages