/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package materiales;

import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author armaf
 */
public class MaterialRepository implements IMaterialRepository{

    public MaterialRepository() {
    }
    
      private static List<Material> materiales = new ArrayList<>();

    @Override
    public List<Material> getMaterial() {
         return materiales;
}

    @Override
    public void eliminarMaterial(int codigo) {
        materiales.removeIf(p -> p.getCodigo() == codigo);
    }

    @Override
    public void insertar(Material material) {
        materiales.add(material);
    }

    
}
