Skip to content

Convert entity classes to Kotlin#322

Merged
tuancoltech merged 36 commits intomainfrom
convert_entity_classes_to_kotlin
May 4, 2025
Merged

Convert entity classes to Kotlin#322
tuancoltech merged 36 commits intomainfrom
convert_entity_classes_to_kotlin

Conversation

@tuancoltech
Copy link
Copy Markdown
Member

@tuancoltech tuancoltech commented May 2, 2025

Convert entity classes to Kotlin

Summary by CodeRabbit

  • Refactor
    • Migrated core data entities from Java to Kotlin for improved maintainability and consistency.
  • Chores
    • Updated internal data structures without affecting user-facing features or functionality.
    • Corrected property naming in various entity mappings to ensure proper data handling.

@tuancoltech tuancoltech requested a review from a team as a code owner May 2, 2025 13:48
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented May 2, 2025

## Walkthrough

This update migrates multiple Room database entity classes from Java to Kotlin within the `ai.elimu.content_provider.room.entity` package. The affected entities include `BaseEntity`, `Emoji`, `Image`, `Letter`, `LetterSound`, `StoryBookParagraph`, `Video`, `Word`, `Emoji_Word`, `Image_Word`, `LetterSound_Sound`, `Number`, `Sound`, `StoryBook`, and `StoryBookChapter`. Each Java class is removed and replaced with an idiomatic Kotlin counterpart that preserves the original fields and annotations for Room persistence, with nullable types and direct property exposure where appropriate. Additionally, a minor property rename is applied in `GsonToRoomConverter` for the `Letter` entity. These changes align with elimu.ai's mission to build innovative learning software that empowers out-of-school children to teach themselves basic reading📖, writing✍🏽 and math🔢 within 6 months.

## Changes

| File(s)                                                                                                                                                                                                                     | Change Summary                                                                                                                                                                                                                      |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| .../room/entity/BaseEntity.java<br>.../room/entity/Emoji.java<br>.../room/entity/Image.java<br>.../room/entity/Letter.java<br>.../room/entity/LetterSound.java<br>.../room/entity/StoryBookParagraph.java<br>.../room/entity/Video.java<br>.../room/entity/Word.java<br>.../room/entity/Emoji_Word.java<br>.../room/entity/Image_Word.java<br>.../room/entity/LetterSound_Sound.java<br>.../room/entity/Number.java<br>.../room/entity/Sound.java<br>.../room/entity/StoryBook.java<br>.../room/entity/StoryBookChapter.java | Removed Java entity classes `BaseEntity`, `Emoji`, `Image`, `Letter`, `LetterSound`, `StoryBookParagraph`, `Video`, `Word`, `Emoji_Word`, `Image_Word`, `LetterSound_Sound`, `Number`, `Sound`, `StoryBook`, and `StoryBookChapter` including all fields and methods. |
| .../room/entity/BaseEntity.kt<br>.../room/entity/Emoji.kt<br>.../room/entity/Image.kt<br>.../room/entity/Letter.kt<br>.../room/entity/LetterSound.kt<br>.../room/entity/StoryBookParagraph.kt<br>.../room/entity/Video.kt<br>.../room/entity/Word.kt<br>.../room/entity/Emoji_Word.kt<br>.../room/entity/Image_Word.kt<br>.../room/entity/LetterSound_Sound.kt<br>.../room/entity/Number.kt<br>.../room/entity/Sound.kt<br>.../room/entity/StoryBook.kt<br>.../room/entity/StoryBookChapter.kt | Added Kotlin entity classes `BaseEntity`, `Emoji`, `Image`, `Letter`, `LetterSound`, `StoryBookParagraph`, `Video`, `Word`, `Emoji_Word`, `Image_Word`, `LetterSound_Sound`, `Number`, `Sound`, `StoryBook`, and `StoryBookChapter` with equivalent properties and Room annotations.                                     |
| .../room/GsonToRoomConverter.kt                                                                                                                                                                                             | Modified property assignment in `getLetter` function: replaced `isDiacritic` with `diacritic` property assignment.                                                                                                               |
| .../ui/emoji/EmojisFragment.kt                                                                                                                                                                                              | Corrected property name from `emoji_id` to `Emoji_id` when assigning emoji ID in `Emoji_Word` entity and updated logging accordingly.                                                                                             |
| .../ui/image/ImagesFragment.kt                                                                                                                                                                                              | Corrected property name from `image_id` to `Image_id` when assigning image ID in `Image_Word` entity and updated logging accordingly.                                                                                             |
| .../ui/letter_sound/LetterSoundsFragment.kt                                                                                                                                                                                  | Corrected property name from `letterSound_id` to `LetterSound_id` when assigning ID in `LetterSound_Sound` entity and updated logging accordingly.                                                                               |

## Suggested reviewers

- jo-elimu

elimu.ai's mission is to build innovative learning software that empowers out-of-school children to teach themselves basic reading📖, writing✍🏽 and math🔢 within 6 months.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6fe129b and 7d06ebc.

📒 Files selected for processing (5)
  • app/src/main/java/ai/elimu/content_provider/room/entity/Content.java (0 hunks)
  • app/src/main/java/ai/elimu/content_provider/room/entity/Content.kt (1 hunks)
  • app/src/main/java/ai/elimu/content_provider/room/entity/StoryBookParagraph_Word.java (0 hunks)
  • app/src/main/java/ai/elimu/content_provider/room/entity/StoryBookParagraph_Word.kt (1 hunks)
  • app/src/main/java/ai/elimu/content_provider/ui/storybook/StoryBooksFragment.kt (1 hunks)
💤 Files with no reviewable changes (2)
  • app/src/main/java/ai/elimu/content_provider/room/entity/Content.java
  • app/src/main/java/ai/elimu/content_provider/room/entity/StoryBookParagraph_Word.java
✅ Files skipped from review due to trivial changes (2)
  • app/src/main/java/ai/elimu/content_provider/room/entity/Content.kt
  • app/src/main/java/ai/elimu/content_provider/room/entity/StoryBookParagraph_Word.kt
⏰ Context from checks skipped due to timeout of 90000ms (9)
  • GitHub Check: lint
  • GitHub Check: build (windows-latest, 21)
  • GitHub Check: test (29)
  • GitHub Check: build (windows-latest, 17)
  • GitHub Check: build (macos-latest, 21)
  • GitHub Check: test (28)
  • GitHub Check: build (macos-latest, 17)
  • GitHub Check: build (ubuntu-latest, 17)
  • GitHub Check: build (ubuntu-latest, 21)
🔇 Additional comments (2)
app/src/main/java/ai/elimu/content_provider/ui/storybook/StoryBooksFragment.kt (2)

174-175: Property name updated correctly to match Kotlin entity class

The change from storyBookParagraph_id to StoryBookParagraph_id (with capital 'S' and 'B') aligns with the newly introduced Kotlin entity classes. While this naming convention with capitalization isn't typical Kotlin style, it maintains consistency with the Room database schema during the Java-to-Kotlin migration.

This change supports elimu.ai's mission to build innovative learning software that empowers out-of-school children to teach themselves basic reading📖, writing✍🏽 and math🔢 within 6 months by ensuring proper data relationships between storybook paragraphs and words.


180-182: Log statement properly updated to match new property name

The log statement has been correctly updated to reference the renamed property StoryBookParagraph_id. This ensures debugging information remains accurate after the entity classes migration to Kotlin.

This attention to detail in logging helps the development team maintain high-quality educational software that fulfills elimu.ai's mission to build innovative learning software that empowers out-of-school children to teach themselves basic reading📖, writing✍🏽 and math🔢 within 6 months.

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@tuancoltech tuancoltech marked this pull request as draft May 2, 2025 13:49
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (3)
app/src/main/java/ai/elimu/content_provider/room/entity/Emoji.kt (1)

8-9: Consider using a Kotlin data class for entities
A data class with constructor parameters can improve immutability, reduce boilerplate, and make your code more idiomatic.

@@ -8,2 +8,6
- @Entity
- class Emoji : Content() {
+ @Entity
+ data class Emoji(
+     var glyph: String,
+     var unicodeVersion: Double = 0.0,
+     var unicodeEmojiVersion: Double = 0.0
+) : Content() {
app/src/main/java/ai/elimu/content_provider/room/entity/BaseEntity.kt (2)

8-16: Consider making BaseEntity abstract
Since BaseEntity is a base for other entities and is not instantiated directly, marking it abstract clarifies intent and prevents misuse.

@@ -8 +8
-open class BaseEntity {
+abstract class BaseEntity {

13-15: Re-evaluate @JvmField usage
@JvmField suppresses generated getters/setters. Room works with Kotlin properties directly—removing it improves encapsulation and future flexibility.

@@ -13,2 +13,1
-    @JvmField
-    @PrimaryKey
+    @PrimaryKey
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ce7ca90 and 74bdf4d.

📒 Files selected for processing (4)
  • app/src/main/java/ai/elimu/content_provider/room/entity/BaseEntity.java (0 hunks)
  • app/src/main/java/ai/elimu/content_provider/room/entity/BaseEntity.kt (1 hunks)
  • app/src/main/java/ai/elimu/content_provider/room/entity/Emoji.java (0 hunks)
  • app/src/main/java/ai/elimu/content_provider/room/entity/Emoji.kt (1 hunks)
💤 Files with no reviewable changes (2)
  • app/src/main/java/ai/elimu/content_provider/room/entity/BaseEntity.java
  • app/src/main/java/ai/elimu/content_provider/room/entity/Emoji.java
⏰ Context from checks skipped due to timeout of 90000ms (9)
  • GitHub Check: test (29)
  • GitHub Check: test (28)
  • GitHub Check: lint
  • GitHub Check: build (macos-latest, 21)
  • GitHub Check: build (windows-latest, 17)
  • GitHub Check: build (windows-latest, 21)
  • GitHub Check: build (macos-latest, 17)
  • GitHub Check: build (ubuntu-latest, 21)
  • GitHub Check: build (ubuntu-latest, 17)
🔇 Additional comments (3)
app/src/main/java/ai/elimu/content_provider/room/entity/Emoji.kt (2)

1-4: Kotlin entity conversion looks good
Great work migrating Emoji to Kotlin; this modernization supports our clean codebase and aligns with elimu.ai’s mission to build innovative learning software that empowers out-of-school children to teach themselves basic reading📖, writing✍🏽 and math🔢 within 6 months.


12-14: Default values for version fields are clear
Initializing unicodeVersion and unicodeEmojiVersion to 0.0 aligns with expected defaults when no version is set.

app/src/main/java/ai/elimu/content_provider/room/entity/BaseEntity.kt (1)

1-4: Package and imports look correct
The ai.elimu.content_provider.room.entity package and PrimaryKey import are appropriate for Room integration.

@tuancoltech tuancoltech force-pushed the convert_entity_classes_to_kotlin branch from 1bc9b1d to d213e52 Compare May 4, 2025 06:48
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
app/src/main/java/ai/elimu/content_provider/room/entity/Image.kt (2)

9-10: Consider specifying the table name explicitly.

While Room will use the class name as the table name by default, it's a good practice to specify it explicitly for clarity and to prevent issues if the class is renamed.

-@Entity
+@Entity(tableName = "Image")

This makes the database schema more explicit and easier to understand, especially for newer team members working on our educational mission.


10-14: Consider adding constructor parameters for required properties.

Since title and imageFormat are marked with lateinit, they are required fields. Consider making them constructor parameters to ensure they are initialized at object creation time, which can help prevent UninitializedPropertyAccessException.

-class Image : Content() {
-    lateinit var title: String
-
-    lateinit var imageFormat: ImageFormat
+class Image(
+    var title: String,
+    var imageFormat: ImageFormat
+) : Content() {

This would make the code more robust and better aligned with Kotlin's best practices for our educational software platform.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 74bdf4d and d213e52.

📒 Files selected for processing (3)
  • app/src/main/java/ai/elimu/content_provider/room/entity/Emoji.kt (1 hunks)
  • app/src/main/java/ai/elimu/content_provider/room/entity/Image.java (0 hunks)
  • app/src/main/java/ai/elimu/content_provider/room/entity/Image.kt (1 hunks)
💤 Files with no reviewable changes (1)
  • app/src/main/java/ai/elimu/content_provider/room/entity/Image.java
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/src/main/java/ai/elimu/content_provider/room/entity/Emoji.kt
⏰ Context from checks skipped due to timeout of 90000ms (9)
  • GitHub Check: test (28)
  • GitHub Check: test (29)
  • GitHub Check: build (ubuntu-latest, 17)
  • GitHub Check: build (macos-latest, 17)
  • GitHub Check: build (windows-latest, 21)
  • GitHub Check: lint
  • GitHub Check: build (windows-latest, 17)
  • GitHub Check: build (ubuntu-latest, 21)
  • GitHub Check: build (macos-latest, 21)
🔇 Additional comments (2)
app/src/main/java/ai/elimu/content_provider/room/entity/Image.kt (2)

1-14: Excellent migration to Kotlin! This looks good overall.

I like the conversion of this entity class to Kotlin! This is a clean implementation that uses Kotlin's concise syntax while maintaining the Room database functionality. The lateinit properties are appropriate for Room entities where properties will be initialized by the framework.

As we continue elimu.ai's mission to build innovative learning software that empowers out-of-school children to teach themselves basic reading📖, writing✍🏽 and math🔢 within 6 months, these code modernization efforts will make our codebase more maintainable and expressive.


6-8: Great documentation reference!

Referencing the model documentation is excellent for maintainability. Consider adding a brief description of what an Image entity represents in the context of our educational content, which would further enhance the documentation.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
app/src/main/java/ai/elimu/content_provider/room/entity/Letter.kt (1)

8-15: Nice Kotlin migration with room for small improvements

The Letter entity has been successfully migrated from Java to Kotlin. The class is properly annotated with @entity and extends the Content class as expected.

Consider a few minor improvements:

  1. The @JvmField annotation is used on text but not on diacritic - for consistency, consider applying it to both properties.
  2. Both properties are nullable - if either is required, consider making them non-nullable.
  3. If text should be searchable, consider adding a Room index.

This Kotlin migration aligns with elimu.ai's mission to build innovative learning software that empowers out-of-school children to teach themselves basic reading📖, writing✍🏽 and math🔢 within 6 months.

@Entity
class Letter : Content() {

    @JvmField
    var text: String? = null

+   @JvmField
    var diacritic: Boolean? = null
}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d213e52 and 3eca460.

📒 Files selected for processing (3)
  • app/src/main/java/ai/elimu/content_provider/room/GsonToRoomConverter.kt (1 hunks)
  • app/src/main/java/ai/elimu/content_provider/room/entity/Letter.java (0 hunks)
  • app/src/main/java/ai/elimu/content_provider/room/entity/Letter.kt (1 hunks)
💤 Files with no reviewable changes (1)
  • app/src/main/java/ai/elimu/content_provider/room/entity/Letter.java
⏰ Context from checks skipped due to timeout of 90000ms (9)
  • GitHub Check: build (windows-latest, 17)
  • GitHub Check: build (windows-latest, 21)
  • GitHub Check: build (macos-latest, 21)
  • GitHub Check: build (macos-latest, 17)
  • GitHub Check: build (ubuntu-latest, 21)
  • GitHub Check: build (ubuntu-latest, 17)
  • GitHub Check: test (29)
  • GitHub Check: test (28)
  • GitHub Check: lint
🔇 Additional comments (2)
app/src/main/java/ai/elimu/content_provider/room/GsonToRoomConverter.kt (1)

39-39: Property name updated correctly for Kotlin convention

The property assignment has been correctly updated from the Java-style isDiacritic to the Kotlin-style diacritic, maintaining consistency with the Letter entity's migration to Kotlin. This change properly aligns with elimu.ai's mission to build innovative learning software that empowers out-of-school children to teach themselves basic reading📖, writing✍🏽 and math🔢 within 6 months.

app/src/main/java/ai/elimu/content_provider/room/entity/Letter.kt (1)

5-7: Good documentation reference

Including a reference to the external model documentation is excellent practice. This helps other developers understand the relationship between this Room entity and the domain model.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
app/src/main/java/ai/elimu/content_provider/room/entity/Video.kt (2)

9-9: Consider adding an explicit table name

I see you've annotated the class with @Entity. For better maintainability and to avoid potential issues if class names change, consider explicitly declaring the table name: @Entity(tableName = "videos").

In line with elimu.ai's mission to build innovative learning software that empowers out-of-school children to teach themselves basic reading📖, writing✍🏽 and math🔢 within 6 months, making our code more maintainable helps us deliver more reliable educational tools.

-@Entity
+@Entity(tableName = "videos")

10-15: Properties could benefit from additional Room annotations

The properties in this Kotlin entity lack some Room-specific annotations that could enhance clarity and database behavior. Consider adding:

  1. Documentation for the properties (KDoc)
  2. @ColumnInfo annotations to explicitly define column names
  3. Validation for the title property if there are constraints

As part of elimu.ai's mission to build innovative learning software that empowers out-of-school children to teach themselves basic reading📖, writing✍🏽 and math🔢 within 6 months, clear and well-structured entity models help ensure our educational content is properly represented in the database.

@Entity(tableName = "videos")
class Video : Content() {
+    /**
+     * The title of the video
+     */
    @JvmField
+    @ColumnInfo(name = "title")
    var title: String = ""

+    /**
+     * The format of the video file
+     */
+    @ColumnInfo(name = "video_format", nullable = false)
    lateinit var videoFormat: VideoFormat
}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3eca460 and fbb2572.

📒 Files selected for processing (8)
  • app/src/main/java/ai/elimu/content_provider/room/entity/LetterSound.java (0 hunks)
  • app/src/main/java/ai/elimu/content_provider/room/entity/LetterSound.kt (1 hunks)
  • app/src/main/java/ai/elimu/content_provider/room/entity/StoryBookParagraph.java (0 hunks)
  • app/src/main/java/ai/elimu/content_provider/room/entity/StoryBookParagraph.kt (1 hunks)
  • app/src/main/java/ai/elimu/content_provider/room/entity/Video.java (0 hunks)
  • app/src/main/java/ai/elimu/content_provider/room/entity/Video.kt (1 hunks)
  • app/src/main/java/ai/elimu/content_provider/room/entity/Word.java (0 hunks)
  • app/src/main/java/ai/elimu/content_provider/room/entity/Word.kt (1 hunks)
💤 Files with no reviewable changes (4)
  • app/src/main/java/ai/elimu/content_provider/room/entity/LetterSound.java
  • app/src/main/java/ai/elimu/content_provider/room/entity/StoryBookParagraph.java
  • app/src/main/java/ai/elimu/content_provider/room/entity/Video.java
  • app/src/main/java/ai/elimu/content_provider/room/entity/Word.java
✅ Files skipped from review due to trivial changes (3)
  • app/src/main/java/ai/elimu/content_provider/room/entity/Word.kt
  • app/src/main/java/ai/elimu/content_provider/room/entity/StoryBookParagraph.kt
  • app/src/main/java/ai/elimu/content_provider/room/entity/LetterSound.kt
⏰ Context from checks skipped due to timeout of 90000ms (9)
  • GitHub Check: lint
  • GitHub Check: test (28)
  • GitHub Check: test (29)
  • GitHub Check: build (windows-latest, 17)
  • GitHub Check: build (windows-latest, 21)
  • GitHub Check: build (ubuntu-latest, 21)
  • GitHub Check: build (ubuntu-latest, 17)
  • GitHub Check: build (macos-latest, 17)
  • GitHub Check: build (macos-latest, 21)
🔇 Additional comments (1)
app/src/main/java/ai/elimu/content_provider/room/entity/Video.kt (1)

14-14: Verify lateinit usage for videoFormat

Using lateinit for videoFormat means it must be initialized before access or you'll get an exception. Make sure this aligns with your application flow. If there are cases where videoFormat might be null, consider using a nullable type with a default value instead.

In supporting elimu.ai's mission to build innovative learning software that empowers out-of-school children to teach themselves basic reading📖, writing✍🏽 and math🔢 within 6 months, robust entity models help prevent runtime crashes that could disrupt a child's learning experience.

-lateinit var videoFormat: VideoFormat
+// If nullable is appropriate:
+var videoFormat: VideoFormat? = null
+
+// Or with a default value if applicable:
+var videoFormat: VideoFormat = VideoFormat.DEFAULT

@tuancoltech tuancoltech marked this pull request as ready for review May 4, 2025 09:33
@tuancoltech tuancoltech merged commit 781b72d into main May 4, 2025
9 checks passed
@tuancoltech tuancoltech deleted the convert_entity_classes_to_kotlin branch May 4, 2025 09:53
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.

1 participant