Exemple #1
0
 @Override
 public List<Camara> getCamerasByUser(Usuario user) {
   Collection<Foto> CollectionPhoto = user.getFotoCollection();
   List<Camara> allCameras = new ArrayList<>();
   for (Foto f : CollectionPhoto) {
     allCameras.add(f.getIdCamara());
   }
   List<Camara> filterCameras = new ArrayList<>();
   for (int i = 0; i < allCameras.size(); i++) {
     if (!filterCameras.contains(allCameras.get(i)) && allCameras.get(i) != null) {
       filterCameras.add(allCameras.get(i));
     }
   }
   return filterCameras;
 }