From 86d7ed235c8b59e3319942691ee3a2c5dffcb3d0 Mon Sep 17 00:00:00 2001 From: Atle Prange Date: Mon, 3 Jun 2019 13:00:10 +0200 Subject: [PATCH] builder.build --- .../src/main/kotlin/org/kantega/niagara/json/JsonEndec.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/niagara-json/src/main/kotlin/org/kantega/niagara/json/JsonEndec.kt b/niagara-json/src/main/kotlin/org/kantega/niagara/json/JsonEndec.kt index e1fc762..1a5ff09 100644 --- a/niagara-json/src/main/kotlin/org/kantega/niagara/json/JsonEndec.kt +++ b/niagara-json/src/main/kotlin/org/kantega/niagara/json/JsonEndec.kt @@ -14,6 +14,9 @@ data class JsonEndec(val encoder:JsonEncoder, val decoder: JsonDecoder) data class EndecBuilder(val encoder:JsonObjectBuilder, val decoder: JsonDecoder) +fun EndecBuilder.build() = + JsonEndec(this.encoder,this.decoder) + fun EndecBuilderREST,HCons> .field(name:String,endec:JsonEndec):EndecBuilder = EndecBuilder(encoder.field(name,endec.encoder),decoder.field(name,endec.decoder))