class SiddhiUtils {

    public static Object[] getOrderedValues(StreamDefinition streamMetaData, List<ColumnNameTypeValue> columns)
            throws AttributeNotExistException {

        Object[] orderedValues = new Object[streamMetaData.getAttributeList().size()];

        for (ColumnNameTypeValue column : columns) {

            // if attribute does not exist, a AttributeNotExistException
            // exception will be thrown
            // XXX change this. create a conversor engine to treat data types.
            if (column.getValue() instanceof String) {
                orderedValues[streamMetaData.getAttributePosition(column.getColumn())] = decodeSiddhiValue(
                        (String) column.getValue(), streamMetaData.getAttributeType(column.getColumn()));
            } else if (column.getValue() instanceof Double) {
                orderedValues[streamMetaData.getAttributePosition(column.getColumn())] = decodeSiddhiValue(
                        (Double) column.getValue(), streamMetaData.getAttributeType(column.getColumn()));
            } else {
                orderedValues[streamMetaData.getAttributePosition(column.getColumn())] = column.getValue();
            }

        }

        return orderedValues;

    }

    private  SiddhiUtils();

}