// Path: src/main/java/org/dataloader/impl/Assertions.java
// public static <T> T nonNull(T t) {
//     return nonNull(t, () -> "nonNull object required");
// }


import static org.dataloader.impl.Assertions.nonNull;
package org.dataloader.stats;


/**
 * This statistics collector keeps dataloader statistics AND also calls the delegate
 * collector at the same time.  This allows you to keep a specific set of statistics
 * and also delegate the calls onto another collector.
 */
public class DelegatingStatisticsCollector implements StatisticsCollector {

    private final StatisticsCollector collector = new SimpleStatisticsCollector();
    private final StatisticsCollector delegateCollector;

    /**
     * @param delegateCollector a non null delegate collector
     */
    public DelegatingStatisticsCollector(StatisticsCollector delegateCollector) {
        this.delegateCollector = nonNull(delegateCollector);
    }

    @Override
    public long incrementLoadCount() {
        delegateCollector.incrementLoadCount();
        return collector.incrementLoadCount();
    }

    @Override
    public long incrementBatchLoadCountBy(long delta) {
// Path: src/main/java/org/dataloader/impl/Assertions.java
// public static <T> T nonNull(T t) {
//     return nonNull(t, () -> "nonNull object required");
// }


// Path: src/main/java/org/dataloader/stats/DelegatingStatisticsCollector.java
import static org.dataloader.impl.Assertions.nonNull;

package org.dataloader.stats;


/**
 * This statistics collector keeps dataloader statistics AND also calls the delegate
 * collector at the same time.  This allows you to keep a specific set of statistics
 * and also delegate the calls onto another collector.
 */
public class DelegatingStatisticsCollector implements StatisticsCollector {

    private final StatisticsCollector collector = new SimpleStatisticsCollector();
    private final StatisticsCollector delegateCollector;

    /**
     * @param delegateCollector a non null delegate collector
     */
    public DelegatingStatisticsCollector(StatisticsCollector delegateCollector) {
        this.delegateCollector = nonNull(delegateCollector);
    }

    @Override
    public long incrementLoadCount() {
        delegateCollector.incrementLoadCount();
        return collector.incrementLoadCount();
    }

    @Override
    public long incrementBatchLoadCountBy(long delta) {
        delegateCollector.incrementBatchLoadCountBy(delta);