From ac80de84ad9bab2eebba61ba7f44a00f5e075aa3 Mon Sep 17 00:00:00 2001 From: Jonathan Trowbridge Date: Tue, 31 Jul 2018 22:17:46 -0400 Subject: [PATCH] master - added value of to state. --- .../simpletorrentandroid/models/TorrentSessionStatus.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/simpletorrentandroid/src/main/java/com/masterwok/simpletorrentandroid/models/TorrentSessionStatus.kt b/simpletorrentandroid/src/main/java/com/masterwok/simpletorrentandroid/models/TorrentSessionStatus.kt index 089c53d..3b677b3 100644 --- a/simpletorrentandroid/src/main/java/com/masterwok/simpletorrentandroid/models/TorrentSessionStatus.kt +++ b/simpletorrentandroid/src/main/java/com/masterwok/simpletorrentandroid/models/TorrentSessionStatus.kt @@ -75,7 +75,11 @@ class TorrentSessionStatus private constructor( FINISHED(3), SEEDING(4), ALLOCATING(5), - CHECKING_RESUME_DATA(6) + CHECKING_RESUME_DATA(6); + + companion object { + fun valueOf(value: Int): State = State.values().first { it.value == value } + } } }