Skip to content

Convert Description to a record class - #1486

Merged
TobiGr merged 7 commits into
TeamNewPipe:devfrom
Isira-Seneviratne:Description-record
Aug 13, 2026
Merged

Convert Description to a record class#1486
TobiGr merged 7 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.

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

LGTM.I'ill squash & rebase once the app PR is ready

@TobiGr TobiGr added the code quality Improvements to the codebase to improve the code quality label Aug 12, 2026
@TobiGr
TobiGr merged commit 1ee1f8e into TeamNewPipe:dev Aug 13, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code quality Improvements to the codebase to improve the code quality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants