Releases: alexarchambault/data-class
v0.2.7
What's Changed
- Don't add canEqual and equals if users already defined them by @alexarchambault in #212
Updates / maintenance
- Update sbt-mima-plugin to 1.1.0 by @scala-steward in #132
- Bump coursier/setup-action from 1.2.0 to 1.2.1 by @dependabot in #133
- Update shapeless to 2.3.10 by @scala-steward in #134
- Update scala-library, scala-reflect to 2.12.17 by @scala-steward in #136
- Update sbt-mima-plugin to 1.1.1 by @scala-steward in #135
- Update sbt to 1.7.2 by @scala-steward in #138
- Update scala-library, scala-reflect to 2.13.10 by @scala-steward in #137
- Update scalafmt-core to 3.6.0 by @scala-steward in #139
- Update sbt to 1.7.3 by @scala-steward in #142
- Update scalafmt-core to 3.6.1 by @scala-steward in #143
- Bump coursier/setup-action from 1.2.1 to 1.3.0 by @dependabot in #141
- Update sbt-ci-release to 1.5.11 by @scala-steward in #140
- Update scalafmt-core to 3.8.4 by @scala-steward in #208
- Fix CI by @alexarchambault in #210
- Update scala-library, scala-reflect to 2.13.16 by @scala-steward in #209
- Update sbt to 1.10.7 by @scala-steward in #207
- Update sbt-ci-release to 1.9.2 by @scala-steward in #206
- Update shapeless to 2.3.11 by @scala-steward in #189
- Bump coursier/setup-action from 1.3.0 to 1.3.9 by @dependabot in #211
- Update scala-library, scala-reflect to 2.12.20 by @scala-steward in #196
- Update sbt-mima-plugin to 1.1.4 by @scala-steward in #193
- Update scalafmt-core to 3.8.5 by @scala-steward in #213
- Drop Scala 2.11 support by @alexarchambault in #214
- Run tests against latest JDK LTS on CI by @alexarchambault in #215
Full Changelog: v0.2.6...v0.2.7
v0.2.6
Updates / maintainance
- Update sbt to 1.4.3 by @scala-steward in #54
- Update sbt to 1.4.4 by @scala-steward in #55
- Update sbt to 1.4.6 by @scala-steward in #57
- Update sbt-ci-release to 1.5.5 by @scala-steward in #56
- Update scala-library, scala-reflect to 2.12.13 by @scala-steward in #60
- Update sbt to 1.4.9 by @scala-steward in #62
- Update sbt-ci-release to 1.5.6 by @scala-steward in #63
- Updates by @alexarchambault in #64
- Bump olafurpg/setup-gpg from v2 to v3 by @dependabot in #65
- Update sbt-ci-release to 1.5.7 by @scala-steward in #66
- Update shapeless to 2.3.7 by @scala-steward in #75
- Update scala-library, scala-reflect to 2.13.6 by @scala-steward in #76
- Update scala-library, scala-reflect to 2.12.16 by @scala-steward in #126
- Update shapeless to 2.3.9 by @scala-steward in #121
- Bump actions/checkout from 2 to 3 by @dependabot in #119
- Update sbt-ci-release to 1.5.10 by @scala-steward in #111
- Update utest to 0.7.10 by @scala-steward in #92
- Update workflow by @alexarchambault in #131
- Update scala-library, scala-reflect to 2.13.8 by @scala-steward in #109
- Update sbt-mima-plugin to 0.9.2 by @scala-steward in #77
- Update sbt to 1.7.1 by @scala-steward in #129
- Update scalafmt-core to 3.5.9 by @scala-steward in #130
New Contributors
- @dependabot made their first contribution in #65
Full Changelog: v0.2.5...v0.2.6
v0.2.5
New features
Allow to cache hash codes
Use like
@data(cachedHashCode = true) class Foo(n: Int, s: String)The hashCode method of Foo is then implemented via a lazy val hashCode = ….
Added in #52, thanks to @oyvindberg.
v0.2.4
Optimization
Use reference equality in generated equals methods
The implementation of equals now compares upfront the values it's given with reference equality. If we are passed the exact same instances, equals returns true, and the fields are not compared one-by-one. Else, the two instances are compared as before.
Added in #48, thanks to @jtjeferreira.
New features
Allow to call apply instead of new in generated with* methods
Passing settersCallApply = true to the @data annotation, like @data(settersCallApply = true), makes it generate with* methods that call apply rather than new to create new instances. Used alongside apply = false, this allows to create instances via a custom apply method, where you can write more complex logic (memoization, etc.).
Added in #49, thanks to @jtjeferreira.
v0.2.3
v0.2.2
Fixes
Don't let Nothing be inferred for type parameters of data classes, when these type parameters aren't used by any of the fields. The following now works for example:
@data class Bar[T](n: Int, s: String)
val barI = Bar[Int](2, "a")
val barNewN = barI.withN(3) // typed as Bar[Int] rather than Bar[Nothing]v0.2.1
v0.2.0
- Fix weird
2.11issues (withoverride valfields, or classpath issues when using data-class as a provided dependency) - Make constructors public by default (as some constructors always ended-up being public according to
javap, making them all public allows not to break binary compatibility upon field addition)
v0.1.6
- Don't generate
applymethods if constructor is explicitly private (like in@data class Foo private (n: Int))
v0.1.5
- Add basic support for multiple parameter groups (departing from how they're handled in case classes - parameters of the extra groups are considered just like the ones of the first group, with setters / accessors, they're read in
equals/hashCodeand in theProductmethods, etc.)