blob: 1bc915ab07a8627e64dbd50ef0ce219687f313dc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
package at.hannibal2.skyhanni.config.migration
import java.lang.reflect.Field
sealed class ResolutionPath {
abstract val parent: ResolutionPath?
abstract val label: String
fun path(): String = (parent?.path()?.let { "$it." } ?: "") + label
object Root : ResolutionPath() {
override val parent: ResolutionPath? get() = null
override val label: String get() = "Root"
}
class FieldChild(val field: Field, override val parent: ResolutionPath) : ResolutionPath() {
override val label: String = field.name
}
class IndirectChild(override val label: String, override val parent: ResolutionPath) : ResolutionPath()
override fun toString(): String {
return path()
}
}
|