Examples of DvdCollection


Examples of org.dvdexchange.domain.DvdCollection

    return collection;
  }

  @Override
  public DvdCollection getDvdsUserOwns(User user) {
    DvdCollection collection = new DvdCollection();
    for (Dvd dvd : m_library) {
      if (user != null && user.equals(dvd.getOwner())) {
        collection.add(dvd);
      }
    }
    return collection;
  }
View Full Code Here

Examples of org.dvdexchange.domain.DvdCollection

    }
   
    public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
      User user = (User) request.getSession().getAttribute("user");
      DvdCollection dvdList = m_dvdLibrary.getDvdsAvailableForUser(user);
      DvdCollection myDvds = m_dvdLibrary.getDvdsUserOwns(user);
        ModelAndView modelAndView = new ModelAndView("dvdLibrary");
        modelAndView.addObject("dvdList", dvdList);
        modelAndView.addObject("myDvds", myDvds);
    return modelAndView;
    }
View Full Code Here

Examples of org.dvdexchange.domain.DvdCollection

    m_library = new ArrayList<Dvd>();
  }
 
  @Override
  public DvdCollection getDvdsAvailableForUser(User user) {
    DvdCollection collection = new DvdCollection();
    for (Dvd dvd : m_library) {
      if (user == null || !user.equals(dvd.getOwner())) {
        collection.add(dvd);
      }
    }
    return collection;
  }
View Full Code Here
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.