-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(common-enums): add common
ValueEnum
interface
This interface exposes a common `value` property such that abstractions can be made on top of this interface, rather than requiring the concrete enum class.
- Loading branch information
1 parent
c1f095f
commit 5973982
Showing
2 changed files
with
17 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
...mmon-enums/src/commonMain/kotlin/io/github/edricchan03/androidx/common/enums/ValueEnum.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package io.github.edricchan03.androidx.common.enums | ||
|
||
/** | ||
* Interface which [Enum]s should implement to indicate that | ||
* they support the [EnumFromValue] specification. | ||
* @since 0.2.0 | ||
*/ | ||
public interface ValueEnum<T> { | ||
/** | ||
* The underlying internal value. | ||
* @since 0.2.0 | ||
*/ | ||
public val value: T | ||
} |