question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

FR: Use PropertyName value as enum value

See original GitHub issue

This is a request to cherry-pick https://github.com/firebase/firebase-android-sdk/issues/239

The example from that project:

public enum MyEnum {
  @PropertyName("one")
  ONE,

  @PropertyName("secondOne")
  SECOND_ONE
}
  • When deserializing:
    • “one” will be mapped to ONE
    • “secondOne” will be mapped to SECOND_ONE
  • When serializing:
    • ONE will be mapped to “one”
    • SECOND_ONE will be mapped to “secondOne”

The cherry-pick is available here: https://github.com/vi-technologies/firebase-admin-java/commit/faac58676ae7539010139ae9ad1b8b717bff8bfd

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
6bangscommented, Aug 22, 2019

Got it, looks like we were transitively depending on an old version of google-cloud-firestore (that didn’t support this use case). All cleared up, thanks.

0reactions
hiranya911commented, Aug 22, 2019

Our Firestore support is entirely provided by the google-cloud-firestore library. When a developer calls FirestoreClient.getFirestore(), we simply call out to that library.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Create Class Property Name from Enum Value - Stack Overflow
I don't know any possible way to obtain what you want with a class. But if you want, you could obtain the desired...
Read more >
Enum.GetName Method (System) - Microsoft Learn
Retrieves the name of the constant in the specified enumeration that has the specified value.
Read more >
TypeScript string enums, and when and how to use them
The enums keyword offers a way for us to define a finite set of values — usually as named constants in a strongly...
Read more >
Set the value of a property that has been declared as an Enum ...
Set the value of a property that has been declared as an Enum type using reflection : PropertyInfo « Reflection « C# /...
Read more >
How To Play With Enum in C# - C# Corner
How to get enum variable name by its value in C#? · ///This is used to get Enum values as array. · private...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found