All Downloads are FREE. Search and download functionalities are using the official Maven repository.

model.properties.properties.kt Maven / Gradle / Ivy

Go to download

Dokka is an API documentation engine for Kotlin and Java, performing the same function as Javadoc for Java

There is a newer version: 2.0.0
Show newest version
package org.jetbrains.dokka.model.properties

interface ExtraProperty {
    interface Key {
        fun mergeStrategyFor(left: T, right: T): MergeStrategy = MergeStrategy.Fail {
            throw NotImplementedError("Property merging for $this is not implemented")
        }
    }

    val key: Key
}

interface CalculatedProperty : ExtraProperty.Key {
    fun calculate(subject: C): T
}

sealed class MergeStrategy {
    class Replace(val newProperty: ExtraProperty) : MergeStrategy()
    object Remove : MergeStrategy()
    class Full(val merger: (preMerged: C, left: C, right: C) -> C) : MergeStrategy()
    class Fail(val error: () -> Nothing) : MergeStrategy()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy