com.jdroid.java.repository
Interface RandomRepository<T extends Identifiable>

Type Parameters:
T - Type of object this repository deals with.
All Superinterfaces:
Repository<T>

public interface RandomRepository<T extends Identifiable>
extends Repository<T>

Repository with the capability of getting random objects.


Method Summary
 T getRandom()
          Gets a random object from the repository.
 List<Long> getRandomIds(Integer maxResults)
          Returns a list of random IDs.
 List<T> getRandomList(Integer maxResults)
          Gets a random list of objects from the repository.
 
Methods inherited from interface com.jdroid.java.repository.Repository
add, addAll, findByField, get, getAll, getAll, getSize, getUniqueInstance, isEmpty, remove, remove, removeAll, removeAll, replaceAll, update
 

Method Detail

getRandomList

List<T> getRandomList(Integer maxResults)
Gets a random list of objects from the repository.

Parameters:
maxResults - Maximum quantity of objects to get.
Returns:
The random list.

getRandom

T getRandom()
Gets a random object from the repository.

Returns:
The random object.

getRandomIds

List<Long> getRandomIds(Integer maxResults)
Returns a list of random IDs.

Parameters:
maxResults - Maximum amount of IDs to return.
Returns:
The random list.


Copyright © 2014. All rights reserved.