Skip to content

Commit

Permalink
release(common-enums): v0.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
EdricChan03 committed Jun 30, 2023
1 parent 5e7f557 commit f79dead
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions androidx/common/common-enums/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Common Enums releases

Common code for enums. An example usage is as follows:

```kt
enum class Example(val value: String) {
One("one"),
Two("two"),
Three("abc");

companion object : EnumFromValue<String, Example>(default = Three) {
override fun fromValueOrNull(value: String) = when (value) {
"one" -> One
"two" -> Two
"abc", "other value" -> Three
else -> null
}
}
```

See the [Module docs](./Module.md) for more information on how to include this artifact in your build script, and the [generated Dokka documentation](https://edricchan03.github.io/androidx-ktx-extras/androidx/common/common-enums/index.html) for API usage.

---

## 0.0.1 (29 Jun 2023)

This version adds an abstract [`EnumFromValue`](https://edricchan03.github.io/androidx-ktx-extras/androidx/common/common-enums/io.github.edricchan03.androidx.common.enums/-enum-from-value/index.html) class that all enums' companion object with an internal representation should inherit.

* Initial release

0 comments on commit f79dead

Please sign in to comment.