@@ -0,0 +1,1553 @@
+package org.textfiledatatools.core.producer;%0A%0Aimport org.textfiledatatools.core.Records;%0Aimport org.textfiledatatools.core.record.SingleRecord;%0Aimport org.textfiledatatools.util.Strings;%0A%0Aimport java.util.Collection;%0Aimport java.util.List;%0Aimport java.util.Objects;%0Aimport java.util.function.Function;%0Aimport java.util.function.Supplier;%0Aimport java.util.stream.Collectors;%0Aimport java.util.stream.Stream;%0A%0A/**%0A * @author Mathias Kalb%0A * @since 0.1%0A */%0Apublic class SingleProducer implements RecordProducer%3CSingleRecord%3E %7B%0A%0A    protected final List%3CSingleRecord%3E records;%0A%0A    public SingleProducer(Collection%3C?%3E values) %7B%0A        this(null, Records.recordIdSequence(), values);%0A    %7D%0A%0A    public SingleProducer(String category, Collection%3C?%3E values) %7B%0A        this(category, Records.recordIdSequence(), values);%0A    %7D%0A%0A    public SingleProducer(String category, Supplier%3CLong%3E recordIdSupplier, Collection%3C?%3E values) %7B%0A        this(category, recordIdSupplier, values, Strings::asString);%0A    %7D%0A%0A    public SingleProducer(String category, Supplier%3CLong%3E recordIdSupplier, Collection%3C?%3E values, Function%3CObject, String%3E toStringFunction) %7B%0A        Objects.requireNonNull(recordIdSupplier);%0A        Objects.requireNonNull(values);%0A        records = values%0A                .stream()%0A                .map(value -%3E new SingleRecord(category, recordIdSupplier.get(), toStringFunction.apply(value)))%0A                .collect(Collectors.toList());%0A    %7D%0A%0A    @Override%0A    public Stream%3CSingleRecord%3E produceStream() %7B%0A        return records.stream();%0A    %7D%0A%0A%7D%0A

Add SingleProducer