Package org.onebusaway.users.model.properties

Examples of org.onebusaway.users.model.properties.Bookmark


    v2.setDefaultLocationLon(v1.getDefaultLocationLon());
    v2.setDefaultLocationName(v1.getDefaultLocationName());

    int index = 0;
    for (String stopId : v1.getBookmarkedStopIds()) {
      Bookmark bookmark = new Bookmark(index++,null,Arrays.asList(stopId),new RouteFilter());
      v2.getBookmarks().add(bookmark);
    }

    return v2;
  }
View Full Code Here


    assertEquals("Seattle", v2.getDefaultLocationName());

    List<Bookmark> bookmarks = v2.getBookmarks();
    assertEquals(2, bookmarks.size());

    Bookmark bookmark = bookmarks.get(0);
    assertEquals(0,bookmark.getId());
    assertNull(bookmark.getName());
    assertEquals(Arrays.asList("1_29214"), bookmark.getStopIds());
    assertTrue(bookmark.getRouteFilter().getRouteIds().isEmpty());

    bookmark = bookmarks.get(1);
    assertEquals(1,bookmark.getId());
    assertNull(bookmark.getName());
    assertEquals(Arrays.asList("1_75403"), bookmark.getStopIds());
    assertTrue(bookmark.getRouteFilter().getRouteIds().isEmpty());
  }
View Full Code Here

    v2.setDefaultLocationLat(47.0);
    v2.setDefaultLocationLon(-122.0);
    v2.setDefaultLocationName("Seattle");
    v2.setRememberPreferencesEnabled(true);

    Bookmark b1 = new Bookmark(0,null,Arrays.asList("1_29214"),new RouteFilter());
    Bookmark b2 = new Bookmark(1,null,Arrays.asList("1_75403", "1_75414"), new RouteFilter());
    v2.setBookmarks(Arrays.asList(b1, b2));

    UserPropertiesV2 result = _service.migrate(v2, UserPropertiesV2.class);
    assertTrue(v2 == result);
View Full Code Here

    int maxId = 0;
    for (Bookmark bookmark : properties.getBookmarks())
      maxId = Math.max(maxId, bookmark.getId() + 1);

    Bookmark bookmark = new Bookmark(maxId, name, stopIds, filter);
    properties.getBookmarks().add(bookmark);

    _userDao.saveOrUpdateUser(user);

    return bookmark.getId();
  }
View Full Code Here

      return;

    List<Bookmark> bookmarks = properties.getBookmarks();

    for (int index = 0; index < bookmarks.size(); index++) {
      Bookmark bookmark = bookmarks.get(index);
      if (bookmark.getId() == id) {
        bookmark = new Bookmark(id, name, stopIds, routeFilter);
        bookmarks.set(index, bookmark);
        _userDao.saveOrUpdateUser(user);
        return;
      }
    }
View Full Code Here

          + user.getId());

    boolean modified = false;

    for (Iterator<Bookmark> it = properties.getBookmarks().iterator(); it.hasNext();) {
      Bookmark bookmark = it.next();
      if (bookmark.getId() == id) {
        it.remove();
        modified = true;
      }
    }
View Full Code Here

TOP

Related Classes of org.onebusaway.users.model.properties.Bookmark

Copyright © 2018 www.massapicom. 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.