ui.consume.kafkaValue.ftl Maven / Gradle / Ivy
<#-- @ftlvariable name="kafkaValue" type="com.infobip.kafkistry.service.consume.KafkaValue" -->
data-base64='${kafkaValue.rawBase64Bytes}'#if>>
<#if kafkaValue.isNull()>
null
<#elseif kafkaValue.isEmpty()>
(empty)
<#elseif kafkaValue.deserializations?size == 0>
[failed deserialization]
<#else>
<#list kafkaValue.deserializations as typeTag, deserialization>
<#assign tagSuffix = deserialization.masked?then(" (MASKED)", "")>
<#assign typeGutter = "${typeTag}${tagSuffix}">
<#assign copyValue = "">
<#switch typeTag>
<#case "BYTES">
<#assign copyValue = kafkaValue.rawBase64Bytes>
<#break>
<#case "STRING">
<#assign copyValue = deserialization.value>
<#break>
<#default>
<#assign copyValue = deserialization.asJson>
#switch>
${typeTag}${tagSuffix}
⧉
#list>
#if>