Update enum values() to entries (#1115)

This commit is contained in:
David Perez 2024-03-08 15:07:12 -06:00 committed by Álison Fernandes
parent 3b33360e58
commit 43a7e2a5fd
12 changed files with 15 additions and 14 deletions

View file

@ -19,4 +19,4 @@ enum class KdfTypeJson {
@Keep
private class KdfTypeSerializer :
BaseEnumeratedIntSerializer<KdfTypeJson>(KdfTypeJson.values())
BaseEnumeratedIntSerializer<KdfTypeJson>(KdfTypeJson.entries.toTypedArray())

View file

@ -40,4 +40,4 @@ enum class TwoFactorAuthMethod(val value: UInt) {
@Keep
private class TwoFactorAuthMethodSerializer :
BaseEnumeratedIntSerializer<TwoFactorAuthMethod>(TwoFactorAuthMethod.values())
BaseEnumeratedIntSerializer<TwoFactorAuthMethod>(TwoFactorAuthMethod.entries.toTypedArray())

View file

@ -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(),
)

View file

@ -24,5 +24,6 @@ enum class CipherRepromptTypeJson {
}
@Keep
private class CipherRepromptTypeSerializer :
BaseEnumeratedIntSerializer<CipherRepromptTypeJson>(CipherRepromptTypeJson.values())
private class CipherRepromptTypeSerializer : BaseEnumeratedIntSerializer<CipherRepromptTypeJson>(
CipherRepromptTypeJson.entries.toTypedArray(),
)

View file

@ -37,4 +37,4 @@ enum class CipherTypeJson {
@Keep
private class CipherTypeSerializer :
BaseEnumeratedIntSerializer<CipherTypeJson>(CipherTypeJson.values())
BaseEnumeratedIntSerializer<CipherTypeJson>(CipherTypeJson.entries.toTypedArray())

View file

@ -37,4 +37,4 @@ enum class FieldTypeJson {
@Keep
private class FieldTypeSerializer :
BaseEnumeratedIntSerializer<FieldTypeJson>(FieldTypeJson.values())
BaseEnumeratedIntSerializer<FieldTypeJson>(FieldTypeJson.entries.toTypedArray())

View file

@ -181,4 +181,4 @@ enum class LinkedIdTypeJson(val value: UInt) {
@Keep
private class LinkedIdTypeSerializer :
BaseEnumeratedIntSerializer<LinkedIdTypeJson>(LinkedIdTypeJson.values())
BaseEnumeratedIntSerializer<LinkedIdTypeJson>(LinkedIdTypeJson.entries.toTypedArray())

View file

@ -79,4 +79,4 @@ enum class PolicyTypeJson {
@Keep
private class PolicyTypeSerializer :
BaseEnumeratedIntSerializer<PolicyTypeJson>(PolicyTypeJson.values())
BaseEnumeratedIntSerializer<PolicyTypeJson>(PolicyTypeJson.entries.toTypedArray())

View file

@ -19,4 +19,4 @@ enum class SecureNoteTypeJson {
@Keep
private class SecureNoteTypeSerializer :
BaseEnumeratedIntSerializer<SecureNoteTypeJson>(SecureNoteTypeJson.values())
BaseEnumeratedIntSerializer<SecureNoteTypeJson>(SecureNoteTypeJson.entries.toTypedArray())

View file

@ -25,4 +25,4 @@ enum class SendTypeJson {
@Keep
private class SendTypeSerializer :
BaseEnumeratedIntSerializer<SendTypeJson>(SendTypeJson.values())
BaseEnumeratedIntSerializer<SendTypeJson>(SendTypeJson.entries.toTypedArray())

View file

@ -49,4 +49,4 @@ enum class UriMatchTypeJson {
@Keep
private class UriMatchTypeSerializer :
BaseEnumeratedIntSerializer<UriMatchTypeJson>(UriMatchTypeJson.values())
BaseEnumeratedIntSerializer<UriMatchTypeJson>(UriMatchTypeJson.entries.toTypedArray())

View file

@ -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