package org.javafxdata.datasources.protocol;

/**
 *
 * @author johan
 */
public class DataRow<T> {

    private int idx;
    private T rowData;

    public DataRow(int idx, T rowdata) {
        this.idx = idx;
        this.rowData = rowdata;
    }

//    public int getIndex() {
//        return idx;
//    }

    public T getRowData() {
        return rowData;
    }

    @Override
    public String toString() {
        String answer = rowData.toString();
        if (rowData instanceof String[]) {
            StringBuilder sb = new StringBuilder();
            for (String el : (String[]) rowData) {
                sb.append(el).append(" ");

            }
            answer = sb.toString();
        }
        return answer;
    }
}
