Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
package com.tngtech.junit.dataprovider.convert;
import static com.tngtech.junit.dataprovider.Preconditions.checkArgument;
import static com.tngtech.junit.dataprovider.Preconditions.checkNotNull;
import static com.tngtech.junit.dataprovider.Preconditions.checkState;
import java.util.ArrayList;
import java.util.List;
/**
* Class to convert dataprovider data (= arguments) to its corresponding parameters.
*/
public class DataConverter {
/**
* Converts the given {@link Object} to a {@link List} of {@link Object}{@code []} with {@link Class}es correspond
* to given {@code parameterTypes}.
*
* Supported types are :
*
*
Object[][]
*
Iterable<Iterable<?>>
*
Iterable<?>
*
Object[]
*
String[]
*
*
* Note: {@link Iterable} can be replaced by any valid subtype. As well as an arbitrary inner type is also accepted.
*
* @param data to be converted
* @param isVarargs determines whether test method has a varargs parameter
* @param parameterTypes required types for {@code data}
* @param context containing settings which should be used to convert given {@code data} (only required for
* converting {@code String[]})
* @return converted data as {@link List}{@code <}{@link Object}{@code []>} with the required {@code parameterTypes}
* @throws NullPointerException if and only if given {@code parameterTypes} are {@code null}
* @throws IllegalArgumentException if and only if given {@code parameterTypes} are empty
* @throws IllegalStateException if and only if given {@code context} is {@code null} but data is {@code String[]}
* @throws ClassCastException if and only if {@code data} is not a compatible type
*/
public List