Package io.cucumber.datatable
Class DataTableType
java.lang.Object
io.cucumber.datatable.DataTableType
A data table type describes how a data table should be represented as an
object.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static interfaceprivate static classprivate static classprivate static classprivate static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final ConversionRequiredprivate final Typeprivate final booleanprivate final DataTableType.RawTableTransformer<?> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateDataTableType(Type type, DataTableType.RawTableTransformer<?> transformer) privateDataTableType(Type type, DataTableType.RawTableTransformer<?> transformer, boolean replaceable) DataTableType(Type type, TableCellTransformer<T> transformer) Creates a data table type that transforms the cells of the table into a list of list of objects.(package private)DataTableType(Type type, TableCellTransformer<T> transformer, boolean replaceable) Creates a data replaceable table type that transforms the entries of the table into a list of objects.DataTableType(Type type, TableEntryTransformer<T> transformer) Creates a data table type that transforms the entries of the table into a list of objects.DataTableType(Type type, TableRowTransformer<T> transformer) Creates a data table type that transforms the rows of the table into a list of objects.DataTableType(Type type, TableTransformer<T> transformer) Creates a data table type that transforms the whole table to a single object. -
Method Summary
Modifier and TypeMethodDescription(package private) DataTableType(package private) static DataTableTypedefaultCell(Type cellType, TableCellByTypeTransformer defaultDataTableTransformer) Creates a data table type for default cell transformer(package private) static DataTableTypedefaultEntry(Type entryType, TableEntryByTypeTransformer defaultDataTableTransformer, TableCellByTypeTransformer tableCellByTypeTransformer) Creates a data table type for default entry transformerboolean(package private) Type(package private) TypeFactory.JavaType(package private) Class<?> inthashCode()(package private) boolean(package private) StringtoString()@Nullable Object
-
Field Details
-
CONVERSION_REQUIRED
-
transformer
-
elementType
-
replaceable
private final boolean replaceable
-
-
Constructor Details
-
DataTableType
-
DataTableType
private DataTableType(Type type, DataTableType.RawTableTransformer<?> transformer, boolean replaceable) -
DataTableType
Creates a data table type that transforms the whole table to a single object.- Type Parameters:
T- seetype- Parameters:
type- the type of the objecttransformer- a function that creates an instance oftypefrom the data table
-
DataTableType
Creates a data table type that transforms the rows of the table into a list of objects.- Type Parameters:
T- seetype- Parameters:
type- the type of the list itemstransformer- a function that creates an instance oftypefrom the data table row
-
DataTableType
Creates a data table type that transforms the entries of the table into a list of objects. An entry consists of the elements of the table header paired with the values of each subsequent row.- Type Parameters:
T- seetype- Parameters:
type- the type of the list itemstransformer- a function that creates an instance oftypefrom the data table entry
-
DataTableType
DataTableType(Type type, TableCellTransformer<T> transformer, boolean replaceable) Creates a data replaceable table type that transforms the entries of the table into a list of objects. An entry consists of the elements of the table header paired with the values of each subsequent row.- Type Parameters:
T- seetype- Parameters:
type- the type of the list itemstransformer- a function that creates an instance oftypefrom the data table entryreplaceable- can this datatable type be replaced with another for the same type
-
DataTableType
Creates a data table type that transforms the cells of the table into a list of list of objects.- Type Parameters:
T- seetype- Parameters:
type- the type of the list of lists itemstransformer- a function that creates an instance oftypefrom the data table cell
-
-
Method Details
-
defaultCell
static DataTableType defaultCell(Type cellType, TableCellByTypeTransformer defaultDataTableTransformer) Creates a data table type for default cell transformer- Parameters:
cellType- class representing cell declared inList<List<T>>defaultDataTableTransformer- default cell transformer registered inDataTableTypeRegistry.setDefaultDataTableCellTransformer(TableCellByTypeTransformer)- Returns:
- new DataTableType witch transforms
List<List<String>>toList<List<T>>
-
defaultEntry
static DataTableType defaultEntry(Type entryType, TableEntryByTypeTransformer defaultDataTableTransformer, TableCellByTypeTransformer tableCellByTypeTransformer) Creates a data table type for default entry transformer- Parameters:
entryType- type representing entry declared inList<T>defaultDataTableTransformer- default entry transformer registered inDataTableTypeRegistry.setDefaultDataTableEntryTransformer(TableEntryByTypeTransformer)- Returns:
- new DataTableType witch transforms
List<List<String>>toList<T>
-
transform
-
getTargetType
TypeFactory.JavaType getTargetType() -
toCanonical
String toCanonical() -
getElementType
Type getElementType() -
getTransformerType
Class<?> getTransformerType() -
isReplaceable
boolean isReplaceable() -
asOptional
DataTableType asOptional() -
toString
-
equals
-
hashCode
public int hashCode()
-