public final class EventsDataset extends Object
Event entities. This
dataset is replicated in the event*.xml dataset files. Bear in mind
that every Event requires an User to be set as its
owner, so whenever a event*.xml dataset is
included, it is required that the users.xml dataset is also
present.| Modifier and Type | Method and Description |
|---|---|
static int |
cancelledEventId()
Returns an
Event that should exist in the database and was cancelled. |
static es.uvigo.esei.dgss.letta.domain.entities.Event[] |
events()
An array of twenty-five events that should exist in the database.
|
static es.uvigo.esei.dgss.letta.domain.entities.Event[] |
eventsWithTwoAttendees()
An array of twenty-five events that should exist in the database, and
with already attending users (two per event) to each event.
|
static es.uvigo.esei.dgss.letta.domain.entities.Event |
eventWithCategory(es.uvigo.esei.dgss.letta.domain.entities.Event.Category cat)
|
static es.uvigo.esei.dgss.letta.domain.entities.Event |
eventWithId(int id)
Returns the unique
Event from the events() array that
has the provided ID. |
static es.uvigo.esei.dgss.letta.domain.entities.Event |
eventWithTitle(String title)
Returns an Event from the
events() array that has the provided
title. |
static es.uvigo.esei.dgss.letta.domain.entities.Event |
existentEvent()
Returns an
Event that should exist in the database. |
static int |
existentEventId()
Returns the ID of a
Event that should exist in the database. |
static es.uvigo.esei.dgss.letta.domain.entities.Event[] |
filterEvents(Predicate<es.uvigo.esei.dgss.letta.domain.entities.Event> f)
|
static es.uvigo.esei.dgss.letta.domain.entities.Event[] |
filterEventsWithTwoJoinedUsers(Predicate<es.uvigo.esei.dgss.letta.domain.entities.Event> f)
Returns the
eventsWithTwoAttendees() that satisfy a given
Predicate. |
static Optional<es.uvigo.esei.dgss.letta.domain.entities.Event> |
findEvent(Predicate<es.uvigo.esei.dgss.letta.domain.entities.Event> f)
|
static es.uvigo.esei.dgss.letta.domain.entities.Event |
findEventOrThrow(Predicate<es.uvigo.esei.dgss.letta.domain.entities.Event> f)
|
static es.uvigo.esei.dgss.letta.domain.entities.Event[] |
futureEvents()
An array of five events that should exist in the database.
|
static es.uvigo.esei.dgss.letta.domain.entities.Event[] |
lessThanFiveEvents()
An array of less than five events that should exist in the database.
|
static es.uvigo.esei.dgss.letta.domain.entities.Event[] |
lessThanTwentyEvents()
An array of less than twenty events that should exist in the database.
|
static <A> List<A> |
mapEvents(Function<es.uvigo.esei.dgss.letta.domain.entities.Event,A> f)
|
static es.uvigo.esei.dgss.letta.domain.entities.Event |
newEvent()
Returns an
Event that should not exist in the database and that
may be used to create a new event. |
static es.uvigo.esei.dgss.letta.domain.entities.Event |
newEventWithoutOwner()
Returns an
Event that should not exist in the database and that
may be used to create a new event. |
static String |
nonExistentDescription()
Returns an
Event description that should not exist in the
database. |
static es.uvigo.esei.dgss.letta.domain.entities.Event |
nonExistentEvent() |
static int |
nonExistentEventId()
Returns an
Event ID that should not exist in the database. |
static String |
nonExistentTitle()
Returns an
Event title that should not exist in the database. |
static es.uvigo.esei.dgss.letta.domain.entities.Event[] |
sortedEvents(Comparator<es.uvigo.esei.dgss.letta.domain.entities.Event> cmp)
Returns the
events() array sorted with a given
Comparator. |
static <C extends Comparable<C>> |
sortedEvents(Function<es.uvigo.esei.dgss.letta.domain.entities.Event,C> f)
|
static es.uvigo.esei.dgss.letta.domain.entities.Event |
updatedEvent()
Returns an
Event that has be modified. |
public static es.uvigo.esei.dgss.letta.domain.entities.Event[] futureEvents()
events.xml file.public static es.uvigo.esei.dgss.letta.domain.entities.Event[] events()
events.xml file.public static es.uvigo.esei.dgss.letta.domain.entities.Event[] filterEvents(Predicate<es.uvigo.esei.dgss.letta.domain.entities.Event> f)
f - The predicate that every resulting Event must satisfy.public static <A> List<A> mapEvents(Function<es.uvigo.esei.dgss.letta.domain.entities.Event,A> f)
public static Optional<es.uvigo.esei.dgss.letta.domain.entities.Event> findEvent(Predicate<es.uvigo.esei.dgss.letta.domain.entities.Event> f)
Optional holding or not the first found Event
in events() that satisfies a given Predicate.f - The predicate that the resulting Event must satisfy.public static es.uvigo.esei.dgss.letta.domain.entities.Event findEventOrThrow(Predicate<es.uvigo.esei.dgss.letta.domain.entities.Event> f)
f - The predicate that the resulting Event must satisfy.IllegalArgumentException - If no Event satisfies the predicate.public static es.uvigo.esei.dgss.letta.domain.entities.Event[] sortedEvents(Comparator<es.uvigo.esei.dgss.letta.domain.entities.Event> cmp)
events() array sorted with a given
Comparator.cmp - The Comparator to sort the Events.public static <C extends Comparable<C>> es.uvigo.esei.dgss.letta.domain.entities.Event[] sortedEvents(Function<es.uvigo.esei.dgss.letta.domain.entities.Event,C> f)
C - The type of the Comparable by which an Event
should be compared.f - The function mapping an Event to a Comparable
instance.public static es.uvigo.esei.dgss.letta.domain.entities.Event eventWithTitle(String title)
events() array that has the provided
title.title - The title of the Event to be returned.IllegalArgumentException - if there is no event with the provided
title.public static es.uvigo.esei.dgss.letta.domain.entities.Event eventWithCategory(es.uvigo.esei.dgss.letta.domain.entities.Event.Category cat)
cat - The Event.Category of the Event to be returned.IllegalArgumentException - If there is no event with the provided
category.public static es.uvigo.esei.dgss.letta.domain.entities.Event eventWithId(int id)
Event from the events() array that
has the provided ID.id - The id of the Event to be returned, as an integer.Event with the provided ID.IllegalArgumentException - if there is no event with the provided ID.public static es.uvigo.esei.dgss.letta.domain.entities.Event[] lessThanFiveEvents()
events-less-than-five.xml file.public static es.uvigo.esei.dgss.letta.domain.entities.Event[] lessThanTwentyEvents()
events-less-than-twenty.xml file.public static es.uvigo.esei.dgss.letta.domain.entities.Event existentEvent()
Event that should exist in the database.Event that should exist in the database.public static int cancelledEventId()
Event that should exist in the database and was cancelled.Event that should exist in the database and was cancelled.public static es.uvigo.esei.dgss.letta.domain.entities.Event updatedEvent()
Event that has be modified.Event that has be modified.public static es.uvigo.esei.dgss.letta.domain.entities.Event nonExistentEvent()
public static int existentEventId()
Event that should exist in the database. This
is the id of the event returned by existentEvent().public static int nonExistentEventId()
Event ID that should not exist in the database.public static String nonExistentTitle()
Event title that should not exist in the database.public static String nonExistentDescription()
Event description that should not exist in the
database.public static es.uvigo.esei.dgss.letta.domain.entities.Event newEvent()
Event that should not exist in the database and that
may be used to create a new event. This includes a User as
creator, retrieved from UsersDataset.existentUser().public static es.uvigo.esei.dgss.letta.domain.entities.Event newEventWithoutOwner()
Event that should not exist in the database and that
may be used to create a new event. This does not include an owner, if
that is required, consider using newEvent() instead.owner not set.public static es.uvigo.esei.dgss.letta.domain.entities.Event[] eventsWithTwoAttendees()
event-attendees.xml file.public static es.uvigo.esei.dgss.letta.domain.entities.Event[] filterEventsWithTwoJoinedUsers(Predicate<es.uvigo.esei.dgss.letta.domain.entities.Event> f)
eventsWithTwoAttendees() that satisfy a given
Predicate.f - The predicate that every resulting Event must satisfy.Copyright © 2016. All rights reserved.