plan.java

来自「有关webserive的interface的讲述 我觉得面向对象编程最重要的优」· Java 代码 · 共 144 行

JAVA
144
字号
package net.seproject.ws.travel;

import net.seproject.ws.flight.Flight;
import net.seproject.ws.hotel.HotelRoom;
import net.seproject.ws.restaurant.RestaTable;

/**
 * 出行方案
 * 
 * @author shufang
 *
 */
public class Plan {

	/**
	 * 方案号
	 * 
	 * <br/><br/>
	 * 唯一标识某个方案
	 */
	private String id;

	/**
	 * 本方案采用的航班、机票信息
	 */
	private Flight theFlight;

	/**
	 * 本方案采用的酒店、客房信息
	 */
	private HotelRoom theHotelRoom;

	/**
	 * 本方案采用的餐厅、餐位信息
	 */
	private RestaTable theRestaTable;

	/**
	 * 本方案采用的机票预订服务URL
	 */
	private String flightServiceUrl;

	/**
	 * 本方案采用的酒店预订服务URL
	 */
	private String hotelServiceUrl;

	/**
	 * 本方案采用的餐厅预订服务URL
	 */
	private String restaurantServiceUrl;

	//
	// 以下是自动生成的get/set方法对。。。
	//

	public Plan() {
		super();
	}

	public Plan(String id, Flight theFlight, HotelRoom theHotelRoom,
			RestaTable theRestaTable, String flightServiceUrl,
			String hotelServiceUrl, String restaurantServiceUrl) {
		super();
		this.id = id;
		this.theFlight = theFlight;
		this.theHotelRoom = theHotelRoom;
		this.theRestaTable = theRestaTable;
		this.flightServiceUrl = flightServiceUrl;
		this.hotelServiceUrl = hotelServiceUrl;
		this.restaurantServiceUrl = restaurantServiceUrl;
	}

	@Override
	public String toString() {
		return String.format(
				"[planId= %s]\n" +
				"[flightServiceUrl= %s]\n %s\n" +
				"[hotelServiceUrl = %s]\n %s\n" +
				"[restauServiceUrl= %s]\n %s\n",
				id,
				flightServiceUrl, theFlight.toString(),
				hotelServiceUrl, theHotelRoom.toString(),
				restaurantServiceUrl, theRestaTable.toString() );
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public Flight getTheFlight() {
		return theFlight;
	}

	public void setTheFlight(Flight theFlight) {
		this.theFlight = theFlight;
	}

	public HotelRoom getTheHotelRoom() {
		return theHotelRoom;
	}

	public void setTheHotelRoom(HotelRoom theHotelRoom) {
		this.theHotelRoom = theHotelRoom;
	}

	public RestaTable getTheRestaTable() {
		return theRestaTable;
	}

	public void setTheRestaTable(RestaTable theRestaTable) {
		this.theRestaTable = theRestaTable;
	}

	public String getFlightServiceUrl() {
		return flightServiceUrl;
	}

	public void setFlightServiceUrl(String flightServiceUrl) {
		this.flightServiceUrl = flightServiceUrl;
	}

	public String getHotelServiceUrl() {
		return hotelServiceUrl;
	}

	public void setHotelServiceUrl(String hotelServiceUrl) {
		this.hotelServiceUrl = hotelServiceUrl;
	}

	public String getRestaurantServiceUrl() {
		return restaurantServiceUrl;
	}

	public void setRestaurantServiceUrl(String restaurantServiceUrl) {
		this.restaurantServiceUrl = restaurantServiceUrl;
	}

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?