mirror of
https://github.com/corda/corda.git
synced 2025-02-21 09:51:57 +00:00
CORDA-553 - Review Comments
This commit is contained in:
parent
7e044e1124
commit
e257872445
@ -34,11 +34,10 @@ import java.lang.reflect.Type
|
|||||||
* @property ordinals Convenience mapping of constant to ordinality
|
* @property ordinals Convenience mapping of constant to ordinality
|
||||||
*/
|
*/
|
||||||
class EnumEvolutionSerializer(
|
class EnumEvolutionSerializer(
|
||||||
clazz: Type,
|
override val type: Type,
|
||||||
factory: SerializerFactory,
|
factory: SerializerFactory,
|
||||||
private val conversions: Map<String, String>,
|
private val conversions: Map<String, String>,
|
||||||
private val ordinals: Map<String, Int>) : AMQPSerializer<Any> {
|
private val ordinals: Map<String, Int>) : AMQPSerializer<Any> {
|
||||||
override val type: Type = clazz
|
|
||||||
override val typeDescriptor = Symbol.valueOf("$DESCRIPTOR_DOMAIN:${fingerprintForType(type, factory)}")!!
|
override val typeDescriptor = Symbol.valueOf("$DESCRIPTOR_DOMAIN:${fingerprintForType(type, factory)}")!!
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
@ -87,7 +86,7 @@ class EnumEvolutionSerializer(
|
|||||||
rules.putAll(defaultRules?.associateBy({ it.new }, { it.old }) ?: emptyMap())
|
rules.putAll(defaultRules?.associateBy({ it.new }, { it.old }) ?: emptyMap())
|
||||||
rules.putAll(renameRules?.associateBy({ it.to }, { it.from }) ?: emptyMap())
|
rules.putAll(renameRules?.associateBy({ it.to }, { it.from }) ?: emptyMap())
|
||||||
|
|
||||||
while (conversions.filter { it.value !in localValues }.isNotEmpty()) {
|
while (conversions.filterNot { it.value in localValues }.isNotEmpty()) {
|
||||||
conversions.mapInPlace { rules[it] ?: it }
|
conversions.mapInPlace { rules[it] ?: it }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user