Package design_patterns.bridge

Source Code of design_patterns.bridge.RemoveReservationAPI

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package design_patterns.bridge;

import beans.Reservation;
import beans.User;
import design_patterns.strategy.Book;
import design_patterns.strategy.Product;
import design_patterns.strategy.Video;
import java.util.Date;

/**
*
* @author root
*/

//ConcreteImplementor
public class RemoveReservationAPI implements ReservationAPI {

     @Override
    public Reservation startReservationManagement(int nextID,Product product, User u) {
        if (product instanceof Video){
            return new Reservation(nextID,u,product,new Date(),new Date(),false);
        }
        else if (product instanceof Book ){
            return new Reservation(nextID,u,product,new Date(),new Date(),false);
        }
        return null;
    }
   
}
TOP

Related Classes of design_patterns.bridge.RemoveReservationAPI

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.