diff options
author | Edoardo La Greca | 2025-06-20 17:49:26 +0200 |
---|---|---|
committer | Edoardo La Greca | 2025-06-20 17:49:26 +0200 |
commit | 3b9056002ba2f21e10481b6bedc47f9b1d572f27 (patch) | |
tree | 66bc9ee12d6a61475f5b5b733ef114f92075baa6 | |
parent | 36bcf8084dbb6b59255cacd80488ab6c5a98da88 (diff) |
add values and fromByte method to NinePMessageType
-rw-r--r-- | src/main/kotlin/NinePMessageType.kt | 37 |
1 files changed, 23 insertions, 14 deletions
diff --git a/src/main/kotlin/NinePMessageType.kt b/src/main/kotlin/NinePMessageType.kt index cd346ae..017fe2e 100644 --- a/src/main/kotlin/NinePMessageType.kt +++ b/src/main/kotlin/NinePMessageType.kt @@ -1,15 +1,24 @@ -enum class NinePMessageType { - VERSION, - AUTH, - FLUSH, - ATTACH, - WALK, - OPEN, - CREATE, - READ, - WRITE, - CLUNK, - REMOVE, - STAT, - WSTAT +/* +TODO: + - add correct values +*/ + +enum class NinePMessageType(val value: Byte) { + VERSION(1), + AUTH(2), + FLUSH(3), + ATTACH(4), + WALK(5), + OPEN(6), + CREATE(7), + READ(8), + WRITE(9), + CLUNK(10), + REMOVE(11), + STAT(12), + WSTAT(13); + + companion object { + fun fromByte(value: Byte) = NinePMessageType.entries.first { it.value == value } + } }
\ No newline at end of file |