diff options
author | sebastian.sellmair <sebastian.sellmair@jetbrains.com> | 2020-08-17 10:46:26 +0200 |
---|---|---|
committer | Sebastian Sellmair <34319766+sellmair@users.noreply.github.com> | 2020-08-17 11:52:28 +0200 |
commit | a2be91ea289ddb1a8634c5fd252243f1b9ab7000 (patch) | |
tree | 682463697296d7084d70ceb2816e65badf668fd0 /core/src/main/kotlin/model/ContentSourceSet.kt | |
parent | b439f0f4da19273a1b60df45aa380ecf2511de73 (diff) | |
download | dokka-a2be91ea289ddb1a8634c5fd252243f1b9ab7000.tar.gz dokka-a2be91ea289ddb1a8634c5fd252243f1b9ab7000.tar.bz2 dokka-a2be91ea289ddb1a8634c5fd252243f1b9ab7000.zip |
Implement SelfRepresentingSingletonSet and let `ContentSourceSet` conform to it
Diffstat (limited to 'core/src/main/kotlin/model/ContentSourceSet.kt')
-rw-r--r-- | core/src/main/kotlin/model/ContentSourceSet.kt | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/core/src/main/kotlin/model/ContentSourceSet.kt b/core/src/main/kotlin/model/ContentSourceSet.kt index 6eee4c94..8a1bf53c 100644 --- a/core/src/main/kotlin/model/ContentSourceSet.kt +++ b/core/src/main/kotlin/model/ContentSourceSet.kt @@ -3,28 +3,20 @@ package org.jetbrains.dokka.model import org.jetbrains.dokka.DokkaConfiguration.DokkaSourceSet import org.jetbrains.dokka.DokkaSourceSetID import org.jetbrains.dokka.Platform +import org.jetbrains.dokka.utilities.SelfRepresentingSingletonSet data class ContentSourceSet( val sourceSetIDs: CompositeSourceSetID, val displayName: String, val analysisPlatform: Platform -) { +) : SelfRepresentingSingletonSet<ContentSourceSet> { constructor(sourceSet: DokkaSourceSet) : this( sourceSetIDs = CompositeSourceSetID(sourceSet.sourceSetID), displayName = sourceSet.displayName, analysisPlatform = sourceSet.analysisPlatform ) - - operator fun contains(sourceSetID: DokkaSourceSetID): Boolean { - return sourceSetID in sourceSetIDs - } - - operator fun contains(sourceSet: DokkaSourceSet): Boolean { - return sourceSet.sourceSetID in this - } } - fun DokkaSourceSet.toContentSourceSet(): ContentSourceSet = ContentSourceSet(this) fun Iterable<DokkaSourceSet>.toContentSourceSets(): Set<ContentSourceSet> = map { it.toContentSourceSet() }.toSet() |