protected void buildMapperTemplate(StreamDefinition streamDefinition, List<Element> unmappedPayloadList) {
        if (unmappedPayloadList != null && !unmappedPayloadList.isEmpty()) {
            templateBuilderMap = new HashMap<>();
            for (Element e : unmappedPayloadList) {
                TemplateBuilder templateBuilder = new TemplateBuilder(streamDefinition, e.getValue());
                if (templateBuilderMap.containsKey(e.getKey())) {
                    throw new SiddhiAppCreationException("Duplicate Keys, " + e.getKey() + ", in @payload() ");
                }
                templateBuilderMap.put(e.getKey(), templateBuilder);
            }
        }
    }
Method to create mapper template.

@param streamDefinition    Stream definition corresponding to mapper
@param unmappedPayloadList mapper payload template list
modules/siddhi-core/src/main/java/io/siddhi/core/stream/output/sink/SinkMapper.java