public final class PrefetchingUserEventDAO extends Object implements UserEventDAO, Describable
| Constructor and Description |
|---|
PrefetchingUserEventDAO(EventDAO dao) |
| Modifier and Type | Method and Description |
|---|---|
void |
describeTo(DescriptionWriter writer)
Write this class's description to a sink.
|
UserHistory<Event> |
getEventsForUser(long user)
Get the events for a specific user.
|
<E extends Event> |
getEventsForUser(long user,
Class<E> type)
Get the events for a specific user, filtering by type.
|
Cursor<UserHistory<Event>> |
streamEventsByUser()
Stream events grouped by user.
|
<E extends Event> |
streamEventsByUser(Class<E> type)
Stream events grouped by user.
|
static Function<EventDAO,UserEventDAO> |
wrapper()
A function that wraps an event DAO in a prefetching user event DAO.
|
@Inject public PrefetchingUserEventDAO(EventDAO dao)
public static Function<EventDAO,UserEventDAO> wrapper()
UserEventDAO, it is returned unwrapped.public Cursor<UserHistory<Event>> streamEventsByUser()
UserEventDAOstreamEventsByUser in interface UserEventDAOpublic <E extends Event> Cursor<UserHistory<E>> streamEventsByUser(Class<E> type)
UserEventDAOstreamEventsByUser in interface UserEventDAOtype - The type of item to look for.type. If a
user exists, but does not have any history, they may or may not be included depending
on the DAO implementation.public UserHistory<Event> getEventsForUser(long user)
UserEventDAOgetEventsForUser in interface UserEventDAOuser - The user ID.null if the user is unknown.public <E extends Event> UserHistory<E> getEventsForUser(long user, Class<E> type)
UserEventDAOgetEventsForUser in interface UserEventDAOuser - The user ID.type - The type of events to retrieve.null if the user is unknown.public void describeTo(DescriptionWriter writer)
DescribabledescribeTo in interface Describablewriter - The description writer to use.