mirror of
https://github.com/bitwarden/android.git
synced 2024-10-31 15:15:34 +03:00
Update enum values() to entries (#1115)
This commit is contained in:
parent
3b33360e58
commit
43a7e2a5fd
12 changed files with 15 additions and 14 deletions
|
@ -19,4 +19,4 @@ enum class KdfTypeJson {
|
|||
|
||||
@Keep
|
||||
private class KdfTypeSerializer :
|
||||
BaseEnumeratedIntSerializer<KdfTypeJson>(KdfTypeJson.values())
|
||||
BaseEnumeratedIntSerializer<KdfTypeJson>(KdfTypeJson.entries.toTypedArray())
|
||||
|
|
|
@ -40,4 +40,4 @@ enum class TwoFactorAuthMethod(val value: UInt) {
|
|||
|
||||
@Keep
|
||||
private class TwoFactorAuthMethodSerializer :
|
||||
BaseEnumeratedIntSerializer<TwoFactorAuthMethod>(TwoFactorAuthMethod.values())
|
||||
BaseEnumeratedIntSerializer<TwoFactorAuthMethod>(TwoFactorAuthMethod.entries.toTypedArray())
|
||||
|
|
|
@ -119,11 +119,11 @@ data class UsernameGenerationOptions(
|
|||
@Keep
|
||||
private class UsernameTypeSerializer :
|
||||
BaseEnumeratedIntSerializer<UsernameGenerationOptions.UsernameType>(
|
||||
UsernameGenerationOptions.UsernameType.values(),
|
||||
UsernameGenerationOptions.UsernameType.entries.toTypedArray(),
|
||||
)
|
||||
|
||||
@Keep
|
||||
private class ForwardedEmailServiceTypeSerializer :
|
||||
BaseEnumeratedIntSerializer<UsernameGenerationOptions.ForwardedEmailServiceType>(
|
||||
UsernameGenerationOptions.ForwardedEmailServiceType.values(),
|
||||
UsernameGenerationOptions.ForwardedEmailServiceType.entries.toTypedArray(),
|
||||
)
|
||||
|
|
|
@ -24,5 +24,6 @@ enum class CipherRepromptTypeJson {
|
|||
}
|
||||
|
||||
@Keep
|
||||
private class CipherRepromptTypeSerializer :
|
||||
BaseEnumeratedIntSerializer<CipherRepromptTypeJson>(CipherRepromptTypeJson.values())
|
||||
private class CipherRepromptTypeSerializer : BaseEnumeratedIntSerializer<CipherRepromptTypeJson>(
|
||||
CipherRepromptTypeJson.entries.toTypedArray(),
|
||||
)
|
||||
|
|
|
@ -37,4 +37,4 @@ enum class CipherTypeJson {
|
|||
|
||||
@Keep
|
||||
private class CipherTypeSerializer :
|
||||
BaseEnumeratedIntSerializer<CipherTypeJson>(CipherTypeJson.values())
|
||||
BaseEnumeratedIntSerializer<CipherTypeJson>(CipherTypeJson.entries.toTypedArray())
|
||||
|
|
|
@ -37,4 +37,4 @@ enum class FieldTypeJson {
|
|||
|
||||
@Keep
|
||||
private class FieldTypeSerializer :
|
||||
BaseEnumeratedIntSerializer<FieldTypeJson>(FieldTypeJson.values())
|
||||
BaseEnumeratedIntSerializer<FieldTypeJson>(FieldTypeJson.entries.toTypedArray())
|
||||
|
|
|
@ -181,4 +181,4 @@ enum class LinkedIdTypeJson(val value: UInt) {
|
|||
|
||||
@Keep
|
||||
private class LinkedIdTypeSerializer :
|
||||
BaseEnumeratedIntSerializer<LinkedIdTypeJson>(LinkedIdTypeJson.values())
|
||||
BaseEnumeratedIntSerializer<LinkedIdTypeJson>(LinkedIdTypeJson.entries.toTypedArray())
|
||||
|
|
|
@ -79,4 +79,4 @@ enum class PolicyTypeJson {
|
|||
|
||||
@Keep
|
||||
private class PolicyTypeSerializer :
|
||||
BaseEnumeratedIntSerializer<PolicyTypeJson>(PolicyTypeJson.values())
|
||||
BaseEnumeratedIntSerializer<PolicyTypeJson>(PolicyTypeJson.entries.toTypedArray())
|
||||
|
|
|
@ -19,4 +19,4 @@ enum class SecureNoteTypeJson {
|
|||
|
||||
@Keep
|
||||
private class SecureNoteTypeSerializer :
|
||||
BaseEnumeratedIntSerializer<SecureNoteTypeJson>(SecureNoteTypeJson.values())
|
||||
BaseEnumeratedIntSerializer<SecureNoteTypeJson>(SecureNoteTypeJson.entries.toTypedArray())
|
||||
|
|
|
@ -25,4 +25,4 @@ enum class SendTypeJson {
|
|||
|
||||
@Keep
|
||||
private class SendTypeSerializer :
|
||||
BaseEnumeratedIntSerializer<SendTypeJson>(SendTypeJson.values())
|
||||
BaseEnumeratedIntSerializer<SendTypeJson>(SendTypeJson.entries.toTypedArray())
|
||||
|
|
|
@ -49,4 +49,4 @@ enum class UriMatchTypeJson {
|
|||
|
||||
@Keep
|
||||
private class UriMatchTypeSerializer :
|
||||
BaseEnumeratedIntSerializer<UriMatchTypeJson>(UriMatchTypeJson.values())
|
||||
BaseEnumeratedIntSerializer<UriMatchTypeJson>(UriMatchTypeJson.entries.toTypedArray())
|
||||
|
|
|
@ -116,7 +116,7 @@ private fun Field.toEncryptedNetworkField(): SyncResponseJson.Cipher.Field =
|
|||
)
|
||||
|
||||
private fun UInt.toNetworkLinkedIdType(): LinkedIdTypeJson =
|
||||
LinkedIdTypeJson.values().first { this == it.value }
|
||||
LinkedIdTypeJson.entries.first { this == it.value }
|
||||
|
||||
/**
|
||||
* Converts a Bitwarden SDK [FieldType] object to a corresponding
|
||||
|
|
Loading…
Reference in a new issue