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

io.cucumber.java8.Java8DefaultDataTableCellTransformerDefinition Maven / Gradle / Ivy

There is a newer version: 7.20.1
Show newest version
package io.cucumber.java8;

import io.cucumber.core.backend.DefaultDataTableCellTransformerDefinition;
import io.cucumber.datatable.TableCellByTypeTransformer;

import java.lang.reflect.Type;

class Java8DefaultDataTableCellTransformerDefinition extends AbstractDatatableElementTransformerDefinition implements DefaultDataTableCellTransformerDefinition {

    Java8DefaultDataTableCellTransformerDefinition(String[] emptyPatterns, DefaultDataTableCellTransformerBody body) {
        super(body, new Exception().getStackTrace()[3], emptyPatterns);
    }

    @Override
    public TableCellByTypeTransformer tableCellByTypeTransformer() {
        return (fromValue, toValueType) -> execute(
            replaceEmptyPatternsWithEmptyString(fromValue),
            toValueType
        );
    }

    private Object execute(String fromValue, Type toValueType) {
        return Invoker.invoke(this, body, method, fromValue, toValueType);
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy