Skip to content
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
This repository was archived by the owner on Feb 26, 2023. It is now read-only.

Sealed Classes integration #15

@AndrewBloom

Description

@AndrewBloom

I have an use case where i have

@builder
sealed class MyBundleClass(open val headerBundle: MyHeaderBundle)
@builder
data class MyFirstBundle(
override val var1: Int,
override val var2: MyType1,
override val headerBundle: MyHeaderBundle
) : MyBundleClass(headerBundle)

@builder
data class MySecondBundle(
override val var4: String,
override val var5: MyType2,
override val headerBundle: MenuHeaderBundle
) : MyBundleClass(headerBundle)

would be cool if I can use the builder on the sealed class so that the MyBundleClassBuilder is a supertype of MyFirstBundleBuilder and MySecondBundle.
I have no idea if that is actually possible, but it would allow me to use the builders to build in multiple steps the objects and on the last phase build them into immutable objects. the parent child relationship between builders would allow to pass the builders to functions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions