public MetaStreamEvent clone() {
        MetaStreamEvent metaStreamEvent = new MetaStreamEvent();
        if (outputData != null) {
            for (Attribute attribute : outputData) {
                metaStreamEvent.addOutputData(attribute);
            }
        }
        if (this.onAfterWindowData != null) {
            metaStreamEvent.onAfterWindowData = new ArrayList<>(onAfterWindowData);
        }
        metaStreamEvent.beforeWindowData = new ArrayList<>(beforeWindowData);

        for (AbstractDefinition abstractDefinition : this.getInputDefinitions()) {
            metaStreamEvent.addInputDefinition(abstractDefinition);
        }
        metaStreamEvent.setInputReferenceId(this.getInputReferenceId());
        metaStreamEvent.setOutputDefinition(this.getOutputStreamDefinition());
        metaStreamEvent.setEventType(this.getEventType());
        metaStreamEvent.setMultiValue(this.isMultiValue());
        return metaStreamEvent;
    }
Universal method to add data to MetaStream event.
Will make sure event will be added to corresponding array by
initializing them accordingly.

@param attribute attribute
@return attribute position
modules/siddhi-core/src/main/java/io/siddhi/core/event/stream/MetaStreamEvent.java