Merged
Conversation
- Introduce `AndroidEventFieldBuilder` interface - Create `TitleBuilder` for handling event titles - Refactor `LegacyAndroidEventBuilder2` to use both new and legacy builders
ead289d to
03eefec
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a new builder pattern for Android event field mapping, using the TITLE field as the initial example. It creates an interface-based architecture that allows for modular handling of individual event fields while maintaining compatibility with existing legacy code.
- Introduces
AndroidEventFieldBuilderinterface for modular field mapping - Creates
TitleBuilderas the first implementation for handling event titles - Refactors
LegacyAndroidEventBuilder2to use the new builder pattern alongside legacy code
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| AndroidEventFieldBuilder.kt | Defines the interface for event field builders |
| TitleBuilder.kt | Implements title field mapping with null/blank handling |
| TitleBuilderTest.kt | Comprehensive tests for title builder functionality |
| LegacyAndroidEventBuilder2.kt | Integration of new builder pattern with legacy code |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/LegacyAndroidEventBuilder2.kt
Show resolved
Hide resolved
sunkup
reviewed
Sep 17, 2025
lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/builder/TitleBuilder.kt
Show resolved
Hide resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces the new builder logic for fields and uses the
TITLEfield as an example.In the future, we will probably need a boolean return value for
AndroidEventFieldBuilder.build()that indicates whether the resultingEntityis valid or not, for instance when there's noDTSTART→false.Roboelectric is used for builder tests because we're only mapping values.
AndroidEventFieldBuilderinterfaceTitleBuilderfor handling event titlesLegacyAndroidEventBuilder2to use both new and legacy builders