From a2be91ea289ddb1a8634c5fd252243f1b9ab7000 Mon Sep 17 00:00:00 2001 From: "sebastian.sellmair" Date: Mon, 17 Aug 2020 10:46:26 +0200 Subject: Implement SelfRepresentingSingletonSet and let `ContentSourceSet` conform to it --- core/src/main/kotlin/model/ContentSourceSet.kt | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'core/src/main/kotlin/model/ContentSourceSet.kt') 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 { 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.toContentSourceSets(): Set = map { it.toContentSourceSet() }.toSet() -- cgit