@Override
    protected void mapAndProcess(Object eventObject, InputEventHandler inputEventHandler)
            throws MappingFailedException, InterruptedException {
        if (eventObject != null) {
            if (eventObject instanceof Event) {
                Event output = new Event(streamDefinition.getAttributeList().size());
                for (AttributeMapping attributeMapping : attributeMappingList) {
                    output.getData()[attributeMapping.getPosition()] = ((Event) eventObject).getData(
                            Integer.parseInt(attributeMapping.getMapping()));
                }
                inputEventHandler.sendEvent(output);
            } else {
                throw new MappingFailedException(Collections.singletonList(new ErroneousEvent(eventObject,
                        "Event object must be either Event[], Event or Object[] " +
                                "but found " + eventObject.getClass().getCanonicalName())));
            }
        }
    }
Test String Mapper implementation to is used for testing purposes.
modules/siddhi-core/src/test/java/io/siddhi/core/transport/TestTrpSourceMapper.java