Matt
11/08/2021, 2:57 PMdave
11/08/2021, 3:12 PMenum class Example {
First, Second;
fun toExt() = name.decapitalize()
companion object {
fun fromCode(value: String) = Example.valueOf(value.capitalize())
}
}
val a = Path.enum<Example>().map(Example::toExt, Example::fromCode).of("example")
Matt
11/08/2021, 3:13 PMdave
11/08/2021, 3:14 PMMatt
11/08/2021, 3:17 PMa
will be a String here though?dave
11/08/2021, 3:19 PMMatt
11/08/2021, 3:28 PMval a: BiDiPathLens<String> = Path.enum<Example>().map(Example::toExt, Example::fromCode).of("example")
dave
11/08/2021, 3:31 PMenum class Example {
First, Second;
companion object {
fun fromCode(value: String) = valueOf(value.capitalize())
}
}
val foobar = Path.map(Example::fromCode).of("example")
Matt
11/08/2021, 3:32 PM