All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.cucumber.core.stepexpression.DataTableArgument Maven / Gradle / Ivy

The newest version!
package io.cucumber.core.stepexpression;

import io.cucumber.datatable.DataTable;
import io.cucumber.datatable.DataTableFormatter;

import java.util.List;

public final class DataTableArgument implements Argument {

    private final RawTableTransformer tableType;
    private final List> argument;

    DataTableArgument(RawTableTransformer tableType, List> argument) {
        this.tableType = tableType;
        this.argument = argument;
    }

    @Override
    public Object getValue() {
        return tableType.transform(argument);
    }

    @Override
    public String toString() {
        return "Table:\n" + getText();
    }

    private String getText() {
        return DataTableFormatter.builder()
                .prefixRow("      ")
                .build()
                .format(DataTable.create(argument));
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy