diff options
| author | Szymon Świstun <sswistun@virtuslab.com> | 2020-03-02 11:07:47 +0100 |
|---|---|---|
| committer | Kamil Doległo <kamilok1965@interia.pl> | 2020-03-04 13:19:17 +0100 |
| commit | 9b7a59cdc93a6dcd9ab0623f6f476abf92d9427d (patch) | |
| tree | 4c6c0f730c6480f824d6e92949c77940929241a1 /core/src/main/kotlin/model/properties | |
| parent | ac590359174995a16a116a96dbb9df5dafa042f5 (diff) | |
| download | dokka-9b7a59cdc93a6dcd9ab0623f6f476abf92d9427d.tar.gz dokka-9b7a59cdc93a6dcd9ab0623f6f476abf92d9427d.tar.bz2 dokka-9b7a59cdc93a6dcd9ab0623f6f476abf92d9427d.zip | |
Add information about modifiers to Documentables' extra properties
Diffstat (limited to 'core/src/main/kotlin/model/properties')
| -rw-r--r-- | core/src/main/kotlin/model/properties/properties.kt | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/core/src/main/kotlin/model/properties/properties.kt b/core/src/main/kotlin/model/properties/properties.kt index 83f8d63d..7010d0df 100644 --- a/core/src/main/kotlin/model/properties/properties.kt +++ b/core/src/main/kotlin/model/properties/properties.kt @@ -1,21 +1,22 @@ package org.jetbrains.dokka.model.properties interface ExtraProperty<in C : Any> { - interface Key<in C: Any, T: Any> { + interface Key<in C : Any, T : Any> { fun mergeStrategyFor(left: T, right: T): MergeStrategy<C> = MergeStrategy.Fail { throw NotImplementedError("Property merging for $this is not implemented") } } + val key: Key<C, *> } -interface CalculatedProperty<in C: Any, T: Any>: ExtraProperty.Key<C, T> { +interface CalculatedProperty<in C : Any, T : Any> : ExtraProperty.Key<C, T> { fun calculate(subject: C): T } sealed class MergeStrategy<in C> { - class Replace<in C : Any>(val newProperty: ExtraProperty<C>): MergeStrategy<C>() - object Remove: MergeStrategy<Any>() - class Full<C: Any>(val merger: (preMerged: C, left: C, right: C) -> C): MergeStrategy<C>() - class Fail(val error: () -> Nothing): MergeStrategy<Any>() + class Replace<in C : Any>(val newProperty: ExtraProperty<C>) : MergeStrategy<C>() + object Remove : MergeStrategy<Any>() + class Full<C : Any>(val merger: (preMerged: C, left: C, right: C) -> C) : MergeStrategy<C>() + class Fail(val error: () -> Nothing) : MergeStrategy<Any>() } |
