How to save custom class inside this class kotlin android

Viewed 37

I have class tree

data class Tree (
        @PrimaryKey(autoGenerate = true)
        val id: Int = 0,
    
        var root: Node? = null
            )

and class Node

class Node(
    var parent: Node? = null,
    var left: Node? = null,
    var right: Node? = null,
    var isRoot: Boolean = false,
    var isLeft: Boolean? = null,
    var isRight: Boolean? = null,
    var hash: Int = 0)

i want to save childs of Node but dont know how, tree saving only root node name

0 Answers
Related