Tabnine Logo
CollectionOptions.setSortOrder
Code IndexAdd Tabnine to your IDE (free)

How to use
setSortOrder
method
in
org.apache.shindig.social.opensocial.spi.CollectionOptions

Best Java code snippets using org.apache.shindig.social.opensocial.spi.CollectionOptions.setSortOrder (Showing top 11 results out of 315)

origin: org.wso2.org.apache.shindig/shindig-social-api

options.setSortOrder(SortOrder.descending);
options.setFilter(PersonService.TOP_FRIENDS_FILTER);
options.setFilterOperation(FilterOperation.present);
origin: org.wso2.org.apache.shindig/shindig-social-api

@Test
public void testGetExpectedUsersForPlural() throws Exception {
 CollectionOptions options = new CollectionOptions();
 options.setSortBy(PersonService.TOP_FRIENDS_SORT);
 options.setSortOrder(SortOrder.ascending);
 options.setFilter(null);
 options.setFilterOperation(FilterOperation.contains);
 options.setFilterValue("");
 options.setFirst(0);
 options.setMax(20);
 RestfulCollection<Person> responseItem = db.getPeople(
   ImmutableSet.of(JOHN_DOE, JANE_DOE), new GroupId(GroupId.Type.friends, null),
   options, Collections.<String>emptySet(), token).get();
 assertNotNull(responseItem);
 assertEquals(4, responseItem.getTotalResults());
 // Test a couple of users
 assertEquals("john.doe", responseItem.getList().get(0).getId());
 assertEquals("jane.doe", responseItem.getList().get(1).getId());
}
origin: org.apache.shindig/shindig-social-api

options.setSortOrder(SortOrder.descending);
options.setFilter(PersonService.TOP_FRIENDS_FILTER);
options.setFilterOperation(FilterOperation.present);
origin: org.apache.shindig/shindig-social-api

@Test
public void testGetExpectedUsersForPlural() throws Exception {
 CollectionOptions options = new CollectionOptions();
 options.setSortBy(PersonService.TOP_FRIENDS_SORT);
 options.setSortOrder(SortOrder.ascending);
 options.setFilter(null);
 options.setFilterOperation(FilterOperation.contains);
 options.setFilterValue("");
 options.setFirst(0);
 options.setMax(20);
 RestfulCollection<Person> responseItem = db.getPeople(
   ImmutableSet.of(JOHN_DOE, JANE_DOE), new GroupId(GroupId.Type.friends, null),
   options, Collections.<String>emptySet(), token).get();
 assertNotNull(responseItem);
 assertEquals(4, responseItem.getTotalResults());
 // Test a couple of users
 assertEquals("john.doe", responseItem.getList().get(0).getId());
 assertEquals("jane.doe", responseItem.getList().get(1).getId());
}
origin: com.lmco.shindig/shindig-social-api

@Test
public void testGetExpectedFriends() throws Exception {
 CollectionOptions options = new CollectionOptions();
 options.setSortBy(PersonService.TOP_FRIENDS_SORT);
 options.setSortOrder(SortOrder.ascending);
 options.setFilter(null);
 options.setFilterOperation(FilterOperation.contains);
 options.setFilterValue("");
 options.setFirst(0);
 options.setMax(20);
 RestfulCollection<Person> responseItem = db.getPeople(
   ImmutableSet.of(CANON_USER), new GroupId(GroupId.Type.friends, null),
   options, Collections.<String>emptySet(), token).get();
 assertNotNull(responseItem);
 assertEquals(4, responseItem.getTotalResults());
 // Test a couple of users
 assertEquals("john.doe", responseItem.getEntry().get(0).getId());
 assertEquals("jane.doe", responseItem.getEntry().get(1).getId());
}
origin: com.lmco.shindig/shindig-social-api

@Test
public void testGetExpectedUsersForPlural() throws Exception {
 CollectionOptions options = new CollectionOptions();
 options.setSortBy(PersonService.TOP_FRIENDS_SORT);
 options.setSortOrder(SortOrder.ascending);
 options.setFilter(null);
 options.setFilterOperation(FilterOperation.contains);
 options.setFilterValue("");
 options.setFirst(0);
 options.setMax(20);
 RestfulCollection<Person> responseItem = db.getPeople(
   ImmutableSet.of(JOHN_DOE, JANE_DOE), new GroupId(GroupId.Type.friends, null),
   options, Collections.<String>emptySet(), token).get();
 assertNotNull(responseItem);
 assertEquals(4, responseItem.getTotalResults());
 // Test a couple of users
 assertEquals("john.doe", responseItem.getEntry().get(0).getId());
 assertEquals("jane.doe", responseItem.getEntry().get(1).getId());
}
origin: org.apache.shindig/shindig-samples

@Test
public void getJohnDoeFriendsOrderedByName() throws Exception {
 // Set collection options
 CollectionOptions collectionOptions = new CollectionOptions();
 collectionOptions.setSortBy("name");
 collectionOptions.setSortOrder(SortOrder.ascending);
 collectionOptions.setMax(20);
 
 // Get all friends of john.doe
 Future<RestfulCollection<Person>> result = this.personServiceDb.getPeople(SpiTestUtil.buildUserIds("john.doe"), new GroupId(GroupId.Type.friends, "@friends"), collectionOptions, Person.Field.ALL_FIELDS, SpiTestUtil.DEFAULT_TEST_SECURITY_TOKEN);
 
 RestfulCollection<Person> peopleCollection = result.get();
 assertEquals(3, peopleCollection.getTotalResults());
 assertEquals(0, peopleCollection.getStartIndex());    
 List<Person> people = peopleCollection.getEntry();    
 // The users should be in alphabetical order
 SpiTestUtil.assertPersonEquals(people.get(0), "george.doe", "George Doe");
 SpiTestUtil.assertPersonEquals(people.get(1), "jane.doe", "Jane Doe");     
}

origin: com.lmco.shindig/shindig-social-api

options.setSortOrder(SortOrder.descending);
options.setFilter(PersonService.TOP_FRIENDS_FILTER);
options.setFilterOperation(FilterOperation.present);
origin: org.apache.shindig/shindig-social-api

@Test
public void testGetExpectedFriends() throws Exception {
 CollectionOptions options = new CollectionOptions();
 options.setSortBy(PersonService.TOP_FRIENDS_SORT);
 options.setSortOrder(SortOrder.ascending);
 options.setFilter(null);
 options.setFilterOperation(FilterOperation.contains);
 options.setFilterValue("");
 options.setFirst(0);
 options.setMax(20);
 RestfulCollection<Person> responseItem = db.getPeople(
   ImmutableSet.of(CANON_USER), new GroupId(GroupId.Type.friends, null),
   options, Collections.<String>emptySet(), token).get();
 assertNotNull(responseItem);
 assertEquals(4, responseItem.getTotalResults());
 // Test a couple of users
 assertEquals("john.doe", responseItem.getList().get(0).getId());
 assertEquals("jane.doe", responseItem.getList().get(1).getId());
}
origin: org.wso2.org.apache.shindig/shindig-social-api

@Test
public void testGetExpectedFriends() throws Exception {
 CollectionOptions options = new CollectionOptions();
 options.setSortBy(PersonService.TOP_FRIENDS_SORT);
 options.setSortOrder(SortOrder.ascending);
 options.setFilter(null);
 options.setFilterOperation(FilterOperation.contains);
 options.setFilterValue("");
 options.setFirst(0);
 options.setMax(20);
 RestfulCollection<Person> responseItem = db.getPeople(
   ImmutableSet.of(CANON_USER), new GroupId(GroupId.Type.friends, null),
   options, Collections.<String>emptySet(), token).get();
 assertNotNull(responseItem);
 assertEquals(4, responseItem.getTotalResults());
 // Test a couple of users
 assertEquals("john.doe", responseItem.getList().get(0).getId());
 assertEquals("jane.doe", responseItem.getList().get(1).getId());
}
origin: org.apache.shindig/shindig-samples

@Test
public void getJohnDoeFriendsOrderedByNameWithPagination() throws Exception {    
 // Set collection options
 CollectionOptions collectionOptions = new CollectionOptions();
 collectionOptions.setSortBy("name");
 collectionOptions.setSortOrder(SortOrder.ascending);
 collectionOptions.setFirst(0);
 collectionOptions.setMax(1);
 
 // Get first friend of john.doe
 Future<RestfulCollection<Person>> result = this.personServiceDb.getPeople(SpiTestUtil.buildUserIds("john.doe"), new GroupId(GroupId.Type.friends, "@friends"), collectionOptions, Person.Field.ALL_FIELDS, SpiTestUtil.DEFAULT_TEST_SECURITY_TOKEN);    
 RestfulCollection<Person> peopleCollection = result.get();
 assertEquals(3, peopleCollection.getTotalResults());
 assertEquals(0, peopleCollection.getStartIndex());    
 List<Person> people = peopleCollection.getEntry();    
 SpiTestUtil.assertPersonEquals(people.get(0), "george.doe", "George Doe");
 
 // Get second friend of john.doe
 collectionOptions.setFirst(1);
 result = this.personServiceDb.getPeople(SpiTestUtil.buildUserIds("john.doe"), new GroupId(GroupId.Type.friends, "@friends"), collectionOptions, Person.Field.ALL_FIELDS, SpiTestUtil.DEFAULT_TEST_SECURITY_TOKEN);
 peopleCollection = result.get();
 assertEquals(3, peopleCollection.getTotalResults());
 assertEquals(1, peopleCollection.getStartIndex());    
 people = peopleCollection.getEntry();    
 SpiTestUtil.assertPersonEquals(people.get(0), "jane.doe", "Jane Doe");    
}

org.apache.shindig.social.opensocial.spiCollectionOptionssetSortOrder

Popular methods of CollectionOptions

  • <init>
  • setFirst
  • setMax
  • getFilter
    This filter can be any field of the object being filtered or the special js filters, hasApp or topF
  • getSortBy
    This sortBy can be any field of the object being sorted or the special js sort of topFriends.
  • getSortOrder
  • setFilter
  • setFilterOperation
  • setFilterValue
  • setSortBy
  • getFilterOperation
  • getFilterValue
    Where a field filter has been specified (ie a non special filter) then this is the value of the filt
  • getFilterOperation,
  • getFilterValue,
  • getFirst,
  • getMax,
  • setUpdatedSince,
  • getOptionalParameter,
  • setOptionalParameters

Popular in Java

  • Updating database using SQL prepared statement
  • compareTo (BigDecimal)
  • getApplicationContext (Context)
  • onCreateOptionsMenu (Activity)
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • Notification (javax.management)
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now