mirror of
https://github.com/owncloud/android-library.git
synced 2025-06-07 16:06:08 +00:00
refactor ShareType
This commit is contained in:
parent
29de5aba34
commit
db478efedc
@ -106,17 +106,7 @@ enum class ShareType constructor(val value: Int) {
|
||||
FEDERATED(6);
|
||||
|
||||
companion object {
|
||||
fun fromValue(value: Int): ShareType? {
|
||||
return when (value) {
|
||||
-1 -> UNKNOWN
|
||||
0 -> USER
|
||||
1 -> GROUP
|
||||
3 -> PUBLIC_LINK
|
||||
4 -> EMAIL
|
||||
5 -> CONTACT
|
||||
6 -> FEDERATED
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
private val values = values();
|
||||
fun fromValue(value: Int) = values.firstOrNull { it.value == value }
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user