public final class EventsDataset extends Object
Event entities. This
dataset is replicated in the event*.xml dataset files.| Modifier and Type | Method and Description |
|---|---|
static es.uvigo.esei.dgss.letta.domain.entities.Event[] |
events()
An array of twenty-five events that should exist in the database.
|
static List<es.uvigo.esei.dgss.letta.domain.entities.Event> |
eventsAsList() |
static es.uvigo.esei.dgss.letta.domain.entities.Event[] |
eventsWithTitleOrDescriptionContaining(String pattern)
An array of
Event that have in them title or description a
pattern provided |
static es.uvigo.esei.dgss.letta.domain.entities.Event[] |
eventsWithTwoJoinedUsers()
An array of twenty-five events that should exist in the database, and
with already joined users (two per event) to each event.
|
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 |
eventWithType(es.uvigo.esei.dgss.letta.domain.entities.EventType type)
|
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
eventsWithTwoJoinedUsers() 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[] |
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 |
newEventWithoutCreator()
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 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)
|
public static es.uvigo.esei.dgss.letta.domain.entities.Event[] events()
events.xml file.public static List<es.uvigo.esei.dgss.letta.domain.entities.Event> eventsAsList()
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 es.uvigo.esei.dgss.letta.domain.entities.Event[] eventsWithTitleOrDescriptionContaining(String pattern)
Event that have in them title or description a
pattern providedpattern - String pattern used to searchEvent containing the pattern on the title or
descriptionpublic 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 eventWithType(es.uvigo.esei.dgss.letta.domain.entities.EventType type)
type - The EventType of the Event to be returned.IllegalArgumentException - if there is no event with the provided
type.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 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 newEventWithoutCreator()
Event that should not exist in the database and that
may be used to create a new event. This does not include a creator, if
that is required, consider using newEvent() instead.creator not set.public static es.uvigo.esei.dgss.letta.domain.entities.Event[] eventsWithTwoJoinedUsers()
users-joins-event.xml file.public static es.uvigo.esei.dgss.letta.domain.entities.Event[] filterEventsWithTwoJoinedUsers(Predicate<es.uvigo.esei.dgss.letta.domain.entities.Event> f)
eventsWithTwoJoinedUsers() that satisfy a given
Predicate.f - The predicate that every resulting Event must satisfy.Copyright © 2015. All rights reserved.