package com.ferienclub.beachclub.esb.messages;

import java.util.Iterator;
import java.util.List;

public class MenuRequest {

	private List menu;
	
	public MenuRequest(){
		
	}
	
	public MenuRequest(List menu){
		this.menu = menu;
	}

	public List getMenu() {
		return menu;
	}

	public void setMenu(List menu) {
		this.menu = menu;
	}
	
	public String toString(){
		StringBuffer sb = new StringBuffer();
		if (menu == null) return "";
		sb.append("********************************\n");
		sb.append("*       BEACH CLUB MENU        *\n");
		sb.append("********************************\n\n");
		sb.append("Item\t\t\t\t\tPrice\n");
		int counter = 1;
		for (Iterator itor = menu.iterator(); itor.hasNext();){
			MenuItem item = (MenuItem)itor.next();
			sb.append(counter++ + ". " + item.getName() + "\t\t\t\t\t" + item.getPrice() + "\n");
		}
		return sb.toString();
	}
	
}
