Newer
Older
StockManagement / src / main / java / resources / Arrival.java
package resources;
import java.util.*;

public class Arrival {
	private Available available;
	private Stock stock;
	private Map.Entry<String, Integer> value;
	public Arrival(Available available, Stock stock) {
		this.available = available;
		this.stock = stock;
	}
	public void arrive(int num, String item) {
		this.value = new AbstractMap.SimpleEntry<>(item, num);
		Map<String, Integer> stock = this.stock.getValue();
		this.available.updateArrival(value, stock);
	}
	public Map.Entry<String, Integer> getValue() {
		return new AbstractMap.SimpleEntry<>(value);
	}
}