aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin/model
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/main/kotlin/model')
-rw-r--r--core/src/main/kotlin/model/Documentable.kt5
-rw-r--r--core/src/main/kotlin/model/doc/DocTag.kt20
-rw-r--r--core/src/main/kotlin/model/doc/TagWrapper.kt42
3 files changed, 53 insertions, 14 deletions
diff --git a/core/src/main/kotlin/model/Documentable.kt b/core/src/main/kotlin/model/Documentable.kt
index 3f50667a..a1df0d0b 100644
--- a/core/src/main/kotlin/model/Documentable.kt
+++ b/core/src/main/kotlin/model/Documentable.kt
@@ -113,11 +113,6 @@ abstract class Documentable {
override fun hashCode() = dri.hashCode()
-
-
- val commentsData: List<DocumentationNode>
- get() = platformInfo.map { it.documentationNode }
-
val briefDocTagString: String
get() =
platformInfo
diff --git a/core/src/main/kotlin/model/doc/DocTag.kt b/core/src/main/kotlin/model/doc/DocTag.kt
index 6d5850a0..0d8b361a 100644
--- a/core/src/main/kotlin/model/doc/DocTag.kt
+++ b/core/src/main/kotlin/model/doc/DocTag.kt
@@ -12,6 +12,16 @@ sealed class DocTag(
return this.children.joinToString(" ") { it.docTagSummary() }
}
+
+ override fun equals(other: Any?): Boolean =
+ (
+ other != null &&
+ other::class == this::class &&
+ this.children == (other as DocTag).children &&
+ this.params == other.params
+ )
+
+ override fun hashCode(): Int = children.hashCode() + params.hashCode()
}
class A(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params)
@@ -64,7 +74,10 @@ class Strong(children: List<DocTag> = emptyList(), params: Map<String, String> =
class Sub(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params)
class Sup(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params)
class Table(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params)
-class Text(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap(), val body: String = "") : DocTag(children, params)
+class Text(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap(), val body: String = "") : DocTag(children, params) {
+ override fun equals(other: Any?): Boolean = super.equals(other) && this.body == (other as Text).body
+ override fun hashCode(): Int = super.hashCode() + body.hashCode()
+}
class TBody(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params)
class Td(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params)
class TFoot(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params)
@@ -76,6 +89,9 @@ class Tt(children: List<DocTag> = emptyList(), params: Map<String, String> = emp
class U(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params)
class Ul(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params)
class Var(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params)
-class DocumentationLink(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap(), val dri: DRI) : DocTag(children, params)
+class DocumentationLink(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap(), val dri: DRI) : DocTag(children, params) {
+ override fun equals(other: Any?): Boolean = super.equals(other) && this.dri == (other as DocumentationLink).dri
+ override fun hashCode(): Int = super.hashCode() + dri.hashCode()
+}
class HorizontalRule : DocTag(emptyList(), emptyMap())
class CustomDocTag(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params) \ No newline at end of file
diff --git a/core/src/main/kotlin/model/doc/TagWrapper.kt b/core/src/main/kotlin/model/doc/TagWrapper.kt
index 8def013e..fa9031d7 100644
--- a/core/src/main/kotlin/model/doc/TagWrapper.kt
+++ b/core/src/main/kotlin/model/doc/TagWrapper.kt
@@ -1,18 +1,46 @@
package org.jetbrains.dokka.model.doc
-sealed class TagWrapper(val root: DocTag)
+sealed class TagWrapper(val root: DocTag) {
+
+ override fun equals(other: Any?): Boolean =
+ (
+ other != null &&
+ this::class == other::class &&
+ this.root == (other as TagWrapper).root
+ )
+
+ override fun hashCode(): Int = root.hashCode()
+}
class Description(root: DocTag) : TagWrapper(root)
class Author(root: DocTag) : TagWrapper(root)
class Version(root: DocTag) : TagWrapper(root)
class Since(root: DocTag) : TagWrapper(root)
-class See(root: DocTag, val name: String) : TagWrapper(root)
-class Param(root: DocTag, val name: String) : TagWrapper(root)
+class See(root: DocTag, val name: String) : TagWrapper(root) {
+ override fun equals(other: Any?): Boolean = super.equals(other) && this.name == (other as See).name
+ override fun hashCode(): Int = super.hashCode() + name.hashCode()
+}
+class Param(root: DocTag, val name: String) : TagWrapper(root) {
+ override fun equals(other: Any?): Boolean = super.equals(other) && this.name == (other as Param).name
+ override fun hashCode(): Int = super.hashCode() + name.hashCode()
+}
class Return(root: DocTag) : TagWrapper(root)
class Receiver(root: DocTag) : TagWrapper(root)
class Constructor(root: DocTag) : TagWrapper(root)
-class Throws(root: DocTag, val name: String) : TagWrapper(root)
-class Sample(root: DocTag, val name: String) : TagWrapper(root)
+class Throws(root: DocTag, val name: String) : TagWrapper(root) {
+ override fun equals(other: Any?): Boolean = super.equals(other) && this.name == (other as Throws).name
+ override fun hashCode(): Int = super.hashCode() + name.hashCode()
+}
+class Sample(root: DocTag, val name: String) : TagWrapper(root) {
+ override fun equals(other: Any?): Boolean = super.equals(other) && this.name == (other as Sample).name
+ override fun hashCode(): Int = super.hashCode() + name.hashCode()
+}
class Deprecated(root: DocTag) : TagWrapper(root)
-class Property(root: DocTag, val name: String) : TagWrapper(root)
+class Property(root: DocTag, val name: String) : TagWrapper(root) {
+ override fun equals(other: Any?): Boolean = super.equals(other) && this.name == (other as Property).name
+ override fun hashCode(): Int = super.hashCode() + name.hashCode()
+}
class Suppress(root: DocTag) : TagWrapper(root)
-class CustomWrapperTag(root: DocTag, val name: String) : TagWrapper(root) \ No newline at end of file
+class CustomWrapperTag(root: DocTag, val name: String) : TagWrapper(root) {
+ override fun equals(other: Any?): Boolean = super.equals(other) && this.name == (other as CustomWrapperTag).name
+ override fun hashCode(): Int = super.hashCode() + name.hashCode()
+} \ No newline at end of file