aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin/model/aditionalExtras.kt
blob: d9587fe3b9b7dc9f69e78a334a8d754b4c1102ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package org.jetbrains.dokka.model

import org.jetbrains.dokka.model.properties.ExtraProperty
import org.jetbrains.dokka.model.properties.MergeStrategy

class AdditionalModifiers(val content: Set<ExtraModifiers>) : ExtraProperty<Documentable> {
    object AdditionalKey : ExtraProperty.Key<Documentable, AdditionalModifiers> {
        override fun mergeStrategyFor(
            left: AdditionalModifiers,
            right: AdditionalModifiers
        ): MergeStrategy<Documentable> = MergeStrategy.Replace(AdditionalModifiers(left.content + right.content))
    }

    override fun equals(other: Any?): Boolean = if (other is AdditionalModifiers) other.content == content else false
    override fun hashCode() = content.hashCode()
    override val key: ExtraProperty.Key<Documentable, *> = AdditionalKey
}