List of usage examples for org.springframework.data.redis.connection DefaultSortParameters DefaultSortParameters
public DefaultSortParameters(@Nullable Range limit, @Nullable Order order, @Nullable Boolean alphabetic)
DefaultSortParameters
instance. From source file:org.springframework.data.redis.connection.jredis.JRedisConnectionIntegrationTests.java
@Test public void testSort() { connection.rPush("sortlist", "foo"); connection.rPush("sortlist", "bar"); connection.rPush("sortlist", "baz"); assertEquals(Arrays.asList(new String[] { "bar", "baz", "foo" }), connection.sort("sortlist", new DefaultSortParameters(null, Order.ASC, true))); }
From source file:org.springframework.data.redis.connection.jredis.JRedisConnectionIntegrationTests.java
@Test public void testSortStore() { connection.rPush("sortlist", "foo"); connection.rPush("sortlist", "bar"); connection.rPush("sortlist", "baz"); assertEquals(Long.valueOf(3), connection.sort("sortlist", new DefaultSortParameters(null, Order.ASC, true), "newlist")); assertEquals(Arrays.asList(new String[] { "bar", "baz", "foo" }), connection.lRange("newlist", 0, 9)); }