Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DB: use @StringDef to annotate possible service and collection types #1225

Open
rfc2822 opened this issue Jan 7, 2025 · 4 comments
Open
Assignees
Labels
refactoring Internal improvement of existing functions

Comments

@rfc2822
Copy link
Member

rfc2822 commented Jan 7, 2025

We should use @StringDef to mark possible values of

  • Collection.type
  • Service.type
  • maybe other values in these or other tables that have fixed possible values.
@rfc2822 rfc2822 added the refactoring Internal improvement of existing functions label Jan 7, 2025
@sunkup
Copy link
Member

sunkup commented Jan 8, 2025

We should use @StringRes to mark possible values of

  • Collection.type

  • Service.type

  • maybe other values in these or other tables that have fixed possible values.

Umm, I don't understand this.

According to the android dev reference on @StringRes we use that annotation to "Denote that an integer parameter, field or method return value is expected to be a String resource reference (e.g. android.R.string.ok)".

The properties Collection.type and Service.type store strings only though, not integers?

@ArnyminerZ
Copy link
Member

Why are we even storing strings in the first place? Shouldn't we simply migrate to enum classes?

@ArnyminerZ
Copy link
Member

ArnyminerZ commented Jan 8, 2025

Umm, I don't understand this.

I think it is a typo, what Ricki is referring to is StringDef.

@rfc2822
Copy link
Member Author

rfc2822 commented Jan 8, 2025

I think it is a typo, what Ricki is referring to is StringDef.

Yes sorry. Changed accordingly.

@ArnyminerZ ArnyminerZ changed the title DB: use @StringRes to annotate possible service and collection types DB: use @StringDef to annotate possible service and collection types Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Internal improvement of existing functions
Projects
Status: Todo
Development

No branches or pull requests

3 participants