Skip to content

Convert Description to a record class#1486

Open
Isira-Seneviratne wants to merge 5 commits into
TeamNewPipe:devfrom
Isira-Seneviratne:Description-record
Open

Convert Description to a record class#1486
Isira-Seneviratne wants to merge 5 commits into
TeamNewPipe:devfrom
Isira-Seneviratne:Description-record

Conversation

@Isira-Seneviratne

@Isira-Seneviratne Isira-Seneviratne commented May 11, 2026

Copy link
Copy Markdown
Member
  • Converted the Description value class to a record for conciseness.
  • Added a static of method to avoid redundant object creation for empty descriptions.
  • Added a Type enum for type safety.

Breaking

Increases the target and source compatibility java version from 11 to 17.


  • I carefully read the contribution guidelines and agree to them.
  • I have tested the API against NewPipe.
  • I agree to create a pull request for NewPipe as soon as possible to make it compatible with the changed API.

@absurdlylongusername

Copy link
Copy Markdown
Member

If we are intending to convert the extractor to Kotlin in the near future, I don't think refactors such as this will hold much value as they will end up being redundant.

@Isira-Seneviratne

Copy link
Copy Markdown
Member Author

Records have some optimizations: https://android-developers.googleblog.com/2023/06/records-in-android-studio-flamingo.html

@sonarqubecloud

Copy link
Copy Markdown

@sonarqubecloud

Copy link
Copy Markdown

@TobiGr TobiGr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. While you are at it, please add a SPDX license header to Description as well as JDoc. I have added the bump of the target and compatibility version to the description. That's a breaking change which should be visible.

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.

3 participants