@Override
    protected Object execute(Object data, State state) {
        if (returnType == Attribute.Type.DOUBLE) {
            return Double.parseDouble(String.valueOf(data));
        } else {
            return Long.parseLong(String.valueOf(data));
        }
    }
The main execution method which will be called upon event arrival
when there are zero or one function parameter

@param data  null if the function parameter count is zero or
             runtime data value of the function parameter
@param state Function state
@return the function result
modules/siddhi-samples/quick-start-samples/src/main/java/io/siddhi/sample/util/CustomFunctionExtension.java