diff options
author | vmishenev <vad-mishenev@yandex.ru> | 2021-07-23 15:26:40 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-23 14:26:40 +0200 |
commit | 355acd296ac16902f588a879e99efd548f0dc0e7 (patch) | |
tree | 4febf3b6fb5531ab2b33c8b070ee695b087a0e98 /core/src/main/kotlin | |
parent | bb712835958c823e06db8c39c0a1d32493f095b8 (diff) | |
download | dokka-355acd296ac16902f588a879e99efd548f0dc0e7.tar.gz dokka-355acd296ac16902f588a879e99efd548f0dc0e7.tar.bz2 dokka-355acd296ac16902f588a879e99efd548f0dc0e7.zip |
Add numeric types of annotation parameter value (#2035)
Diffstat (limited to 'core/src/main/kotlin')
-rw-r--r-- | core/src/main/kotlin/model/additionalExtras.kt | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/core/src/main/kotlin/model/additionalExtras.kt b/core/src/main/kotlin/model/additionalExtras.kt index f092572a..9249b089 100644 --- a/core/src/main/kotlin/model/additionalExtras.kt +++ b/core/src/main/kotlin/model/additionalExtras.kt @@ -72,7 +72,24 @@ data class AnnotationValue(val annotation: Annotations.Annotation) : AnnotationP data class ArrayValue(val value: List<AnnotationParameterValue>) : AnnotationParameterValue() data class EnumValue(val enumName: String, val enumDri: DRI) : AnnotationParameterValue() data class ClassValue(val className: String, val classDRI: DRI) : AnnotationParameterValue() -data class StringValue(val value: String) : AnnotationParameterValue() { +abstract class LiteralValue : AnnotationParameterValue() { + abstract fun text() : String +} +data class IntValue(val value: Int) : LiteralValue() { + override fun text(): String = value.toString() +} + +data class LongValue(val value: Long) : LiteralValue() { + override fun text(): String = value.toString() +} +data class FloatValue(val value: Float) : LiteralValue() { + override fun text(): String = value.toString() +} +data class DoubleValue(val value: Double) : LiteralValue() { + override fun text(): String = value.toString() +} +data class StringValue(val value: String) : LiteralValue() { + override fun text(): String = value override fun toString(): String = value } |