// Path: src/main/java/org/biiig/foodbroker/pile/VendorPile.java
// public class VendorPile extends AbstractMasterDataPile {
// 
//     private final List<Vendor> vendors;
// 
//     public VendorPile(List<Vendor> vendors){
//         super(vendors.size());
//         this.vendors = vendors;
//     }
// 
//     @Override
//     public Vendor nextInstance() {
//         return vendors.get(nextId());
//     }
// }


import org.biiig.foodbroker.pile.VendorPile;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
package org.biiig.foodbroker.model;



/**
 * Created by peet on 14.11.14.
 */
public class VendorFactory extends AbstractMasterDataFactory {

    private final List<Vendor> vendors = new ArrayList<>();

    @Override
    public Vendor newInstance(Map<String, Object> baseValues) {
        Vendor vendor = new Vendor(baseValues);
        this.vendors.add(vendor);
        return vendor;
    }

    public VendorPile newVendorPile(){
// Path: src/main/java/org/biiig/foodbroker/pile/VendorPile.java
// public class VendorPile extends AbstractMasterDataPile {
// 
//     private final List<Vendor> vendors;
// 
//     public VendorPile(List<Vendor> vendors){
//         super(vendors.size());
//         this.vendors = vendors;
//     }
// 
//     @Override
//     public Vendor nextInstance() {
//         return vendors.get(nextId());
//     }
// }


// Path: src/main/java/org/biiig/foodbroker/model/VendorFactory.java
import org.biiig.foodbroker.pile.VendorPile;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

package org.biiig.foodbroker.model;



/**
 * Created by peet on 14.11.14.
 */
public class VendorFactory extends AbstractMasterDataFactory {

    private final List<Vendor> vendors = new ArrayList<>();

    @Override
    public Vendor newInstance(Map<String, Object> baseValues) {
        Vendor vendor = new Vendor(baseValues);
        this.vendors.add(vendor);
        return vendor;
    }

    public VendorPile newVendorPile(){
        return new VendorPile(vendors);