// Path: berserker-commons/src/main/java/io/smartcat/berserker/api/DataSource.java
// public interface DataSource<T> {
// 
//     /**
//      * Returns true if data source can provide next value, otherwise false.
//      *
//      * @param time Relative time in nanoseconds from starting load generator. Time can be used for implementing time
//      *            dependent data source which can then return data with time stamps and/or data influenced by time in
//      *            any other way.
//      * @return True if data source can provide next value, otherwise false.
//      */
//     boolean hasNext(long time);
// 
//     /**
//      * Returns next value from this data source.
//      *
//      * @param time Relative time in nanoseconds from starting load generator. Time can be used for implementing time
//      *            dependent data source which can then return data with time stamps and/or data influenced by time in
//      *            any other way.
//      * @return Next value from this data source.
//      */
//     T getNext(long time);
// }
// 
// Path: berserker-core/src/main/java/io/smartcat/berserker/datasource/RandomDoubleDataSource.java
// public class RandomDoubleDataSource implements DataSource<Double> {
// 
//     private final Iterator<Double> it = new SplittableRandom().doubles().iterator();
// 
//     @Override
//     public boolean hasNext(long time) {
//         return true;
//     }
// 
//     @Override
//     public Double getNext(long time) {
//         return it.next();
//     }
// }
// 
// Path: berserker-core/src/main/java/io/smartcat/berserker/datasource/RandomIntDataSource.java
// public class RandomIntDataSource implements DataSource<Integer> {
// 
//     private final Iterator<Integer> it = new SplittableRandom().ints().iterator();
// 
//     @Override
//     public boolean hasNext(long time) {
//         return true;
//     }
// 
//     @Override
//     public Integer getNext(long time) {
//         return it.next();
//     }
// }
// 
// Path: berserker-core/src/main/java/io/smartcat/berserker/datasource/RandomLongDataSource.java
// public class RandomLongDataSource implements DataSource<Long> {
// 
//     private final Iterator<Long> it = new SplittableRandom().longs().iterator();
// 
//     @Override
//     public boolean hasNext(long time) {
//         return true;
//     }
// 
//     @Override
//     public Long getNext(long time) {
//         return it.next();
//     }
// }


import java.util.Map;
import io.smartcat.berserker.api.DataSource;
import io.smartcat.berserker.datasource.RandomDoubleDataSource;
import io.smartcat.berserker.datasource.RandomIntDataSource;
import io.smartcat.berserker.datasource.RandomLongDataSource;
package io.smartcat.berserker.configuration;



/**
 * Configuration to construct one of the following: {@link RandomIntDataSource}, {@link RandomLongDataSource} or
 * {@link RandomDoubleDataSource}.
 *
 * Map needs to contain key '<code>type</code>' and have one of the following values: '<code>int</code>',
 * '<code>long</code>', '<code>double</code>'.
 */
public class RandomNumberDataSourceConfiguration implements DataSourceConfiguration {

    private static final String TYPE = "type";
    private static final String TYPE_INT = "int";
    private static final String TYPE_LONG = "long";
    private static final String TYPE_DOUBLE = "double";

    @Override
    public String getName() {
        return "RandomDataSource";
    }

    @Override
// Path: berserker-commons/src/main/java/io/smartcat/berserker/api/DataSource.java
// public interface DataSource<T> {
// 
//     /**
//      * Returns true if data source can provide next value, otherwise false.
//      *
//      * @param time Relative time in nanoseconds from starting load generator. Time can be used for implementing time
//      *            dependent data source which can then return data with time stamps and/or data influenced by time in
//      *            any other way.
//      * @return True if data source can provide next value, otherwise false.
//      */
//     boolean hasNext(long time);
// 
//     /**
//      * Returns next value from this data source.
//      *
//      * @param time Relative time in nanoseconds from starting load generator. Time can be used for implementing time
//      *            dependent data source which can then return data with time stamps and/or data influenced by time in
//      *            any other way.
//      * @return Next value from this data source.
//      */
//     T getNext(long time);
// }
// 
// Path: berserker-core/src/main/java/io/smartcat/berserker/datasource/RandomDoubleDataSource.java
// public class RandomDoubleDataSource implements DataSource<Double> {
// 
//     private final Iterator<Double> it = new SplittableRandom().doubles().iterator();
// 
//     @Override
//     public boolean hasNext(long time) {
//         return true;
//     }
// 
//     @Override
//     public Double getNext(long time) {
//         return it.next();
//     }
// }
// 
// Path: berserker-core/src/main/java/io/smartcat/berserker/datasource/RandomIntDataSource.java
// public class RandomIntDataSource implements DataSource<Integer> {
// 
//     private final Iterator<Integer> it = new SplittableRandom().ints().iterator();
// 
//     @Override
//     public boolean hasNext(long time) {
//         return true;
//     }
// 
//     @Override
//     public Integer getNext(long time) {
//         return it.next();
//     }
// }
// 
// Path: berserker-core/src/main/java/io/smartcat/berserker/datasource/RandomLongDataSource.java
// public class RandomLongDataSource implements DataSource<Long> {
// 
//     private final Iterator<Long> it = new SplittableRandom().longs().iterator();
// 
//     @Override
//     public boolean hasNext(long time) {
//         return true;
//     }
// 
//     @Override
//     public Long getNext(long time) {
//         return it.next();
//     }
// }


// Path: berserker-core/src/main/java/io/smartcat/berserker/configuration/RandomNumberDataSourceConfiguration.java
import java.util.Map;
import io.smartcat.berserker.api.DataSource;
import io.smartcat.berserker.datasource.RandomDoubleDataSource;
import io.smartcat.berserker.datasource.RandomIntDataSource;
import io.smartcat.berserker.datasource.RandomLongDataSource;

package io.smartcat.berserker.configuration;



/**
 * Configuration to construct one of the following: {@link RandomIntDataSource}, {@link RandomLongDataSource} or
 * {@link RandomDoubleDataSource}.
 *
 * Map needs to contain key '<code>type</code>' and have one of the following values: '<code>int</code>',
 * '<code>long</code>', '<code>double</code>'.
 */
public class RandomNumberDataSourceConfiguration implements DataSourceConfiguration {

    private static final String TYPE = "type";
    private static final String TYPE_INT = "int";
    private static final String TYPE_LONG = "long";
    private static final String TYPE_DOUBLE = "double";

    @Override
    public String getName() {
        return "RandomDataSource";
    }

    @Override
    public DataSource<?> getDataSource(Map<String, Object> configuration) throws ConfigurationParseException {