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

refactor: create enum class for label type #124

Merged
merged 5 commits into from
Jan 15, 2024

Conversation

nsenave
Copy link
Contributor

@nsenave nsenave commented Nov 28, 2023

Summary

The "type" property of label objects was implemented as a String. Yet, only precise values are valid for Lunatic.

➡️ The string property should be replaced with an enum

Goal: apply this change in a transparent way, to do it gradually.

Done

  • Methods String getType() and setType(String) are unchanged and marked as @Deprecated
  • Create LabelTypeEnum class
  • Add methods LabelTypeEnum getTypeEnum() and setType(LabelTypeEnum)
  • Getters and setters are made so that the usage of string or enum for this property is as transparent as possible in the java api of the lib
  • Serialization and deserialization of this property is transparent for clients (json content is unchanged)

In a later version:

  • the string version of this property will be completely removed
  • the getType() method will return a LabelTypeEnum value
  • the getTypeEnum() method will be marked as @Deprecated

In an even later version:

  • the getTypeEnum() method will be removed

(In the end: it will be as if this property has always been an enum)

@nsenave nsenave requested a review from laurentC35 November 28, 2023 15:29
@nsenave nsenave self-assigned this Nov 28, 2023
@nsenave nsenave linked an issue Nov 28, 2023 that may be closed by this pull request
Copy link

👋 Version 3.2.6-SNAPSHOT deployed on maven central repository

Copy link

👋 Version 3.2.7-SNAPSHOT deployed on maven central repository

Copy link

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

2 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@nsenave nsenave merged commit 03edc1b into v3-main Jan 15, 2024
2 checks passed
@nsenave nsenave deleted the refactor/v3-proper-label-type branch January 15, 2024 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enum for valid label types
1 participant