Skip to content

Commit 78bbd5f

Browse files
committed
Add kdoc and remove redundant annotation dependency
1 parent 4a71e76 commit 78bbd5f

File tree

3 files changed

+20
-7
lines changed

3 files changed

+20
-7
lines changed

workflow-core/build.gradle.kts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,5 @@ kotlin {
3030
implementation(libs.kotlin.test.jdk)
3131
}
3232
}
33-
val jvmMain by getting {
34-
dependencies {
35-
compileOnly(libs.jetbrains.annotations)
36-
}
37-
}
3833
}
3934
}

workflow-core/src/commonMain/kotlin/com/squareup/workflow1/WorkflowIdentifier.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ import kotlin.reflect.KType
3838
* snapshotted.
3939
*
4040
* @constructor
41-
* @param type The [KClass] of the [Workflow] this identifier identifies, or the [KType] of an
42-
* [unsnapshottableIdentifier].
41+
* @param type Wrapper around the [KClass] of the [Workflow] this identifier identifies, or the
42+
* [KType] of an [unsnapshottableIdentifier].
4343
* @param proxiedIdentifier An optional identifier from [ImpostorWorkflow.realIdentifier] that will
4444
* be used to further narrow the scope of this identifier.
4545
* @param description Implementation of [ImpostorWorkflow.describeRealIdentifier].

workflow-core/src/commonMain/kotlin/com/squareup/workflow1/WorkflowIdentifierType.kt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,22 @@ package com.squareup.workflow1
33
import kotlin.reflect.KClass
44
import kotlin.reflect.KType
55

6+
/**
7+
* Represents a subset of [KAnnotatedElement], namely [KClass] or [KType]. Used by the runtime to
8+
* determine whether a [WorkflowIdentifier], and thus the [Workflow] it identifies, is serializable
9+
* or not via the [Snapshot] mechanism.
10+
*/
611
public sealed class WorkflowIdentifierType {
712

813
public abstract val typeName: String
914

15+
/**
16+
* A [WorkflowIdentifier] is snapshottable if its type is this [Snapshottable] class.
17+
*
18+
* @constructor
19+
* @param typeName The qualified name of its corresponding [Workflow].
20+
* @param kClass The [KClass] of the [Workflow] this helps identify.
21+
*/
1022
public data class Snapshottable(
1123
override val typeName: String,
1224
val kClass: KClass<*>? = null,
@@ -16,6 +28,12 @@ public sealed class WorkflowIdentifierType {
1628
)
1729
}
1830

31+
/**
32+
* A [WorkflowIdentifier] is unsnapshottable if its type is this [Unsnapshottable] class.
33+
*
34+
* @constructor
35+
* @param kType The [KType] of the [Workflow] this helps identify.
36+
*/
1937
public data class Unsnapshottable(val kType: KType) : WorkflowIdentifierType() {
2038
init {
2139
require(kType.classifier is KClass<*>) {

0 commit comments

Comments
 (0)