public class Event extends Object implements EventModel<Event>
Modifier | Constructor and Description |
---|---|
protected |
Event(String type,
Identification source,
List<String> descriptors)
Creates a new Event Object
|
protected |
Event(String type,
Identification source,
ListResourceProvider listResourceContainer,
List<String> descriptors,
EventBehaviourController eventBehaviourController)
Creates a new Event Object
|
Modifier and Type | Method and Description |
---|---|
Event |
addDescriptor(String descriptor)
sets the Descriptors (but not the Event-Type).
|
Event |
addEventLifeCycleListener(EventLifeCycle eventLifeCycle,
java.util.function.Consumer<EventLifeCycle> cycleCallback)
adds the Consumer to the specified EventLifeCycle.
|
Event |
addResource(ResourceModel resource)
adds a Resource to the Container
|
Event |
addResources(List<ResourceModel> resources)
adds a List of Resources to the Container
|
boolean |
containsDescriptor(String descriptor)
returns whether the event contains the specific descriptor.
|
static Optional<Event> |
createEvent(String type,
Identification source)
Creates a new Event Object
|
static Optional<Event> |
createEvent(String type,
Identification source,
List<String> descriptors)
Creates a new Event Object
|
List<String> |
getAllInformations()
returns a List containing all the Descriptors and the type.
|
List<String> |
getDescriptors()
returns a List containing all the Descriptors.
|
EventBehaviourControllerModel |
getEventBehaviourController()
returns the associated EventBehaviourController
|
String |
getID()
The ID of the Event.
|
ListResourceProvider |
getListResourceContainer()
returns all the Resources the Event currently has
|
Identification |
getSource()
returns the Source of the Event, e.g.
|
String |
getType()
The type of the Event.
|
void |
lifecycleCallback(EventLifeCycle eventLifeCycle) |
Event |
replaceDescriptors(List<String> descriptors)
replaces the Descriptors
|
Event |
setDescriptors(List<String> descriptors)
sets the Descriptors (but not the Event-Type).
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
isOwner
protected Event(String type, Identification source, List<String> descriptors) throws IllegalArgumentException
type
- the Type of the Event, try to use the predefined Event typessource
- the source of the Event, most likely a this reference.descriptors
- the descriptors to initialize the Event withIllegalArgumentException
- if one of the Arguments is null or emptyprotected Event(String type, Identification source, ListResourceProvider listResourceContainer, List<String> descriptors, EventBehaviourController eventBehaviourController) throws IllegalArgumentException
type
- the Type of the Event, try to use the predefined Event typessource
- the source of the Event, most likely a this reference.listResourceContainer
- the ResourceContainerdescriptors
- the descriptors to initialize the Event witheventBehaviourController
- the Controller of the EventIllegalArgumentException
- if one of the Arguments is null or emptypublic static Optional<Event> createEvent(String type, Identification source)
type
- the Type of the Event, try to use the predefined Event typessource
- the source of the Event, most likely a this reference.public static Optional<Event> createEvent(String type, Identification source, List<String> descriptors)
type
- the Type of the Event, try to use the predefined Event typessource
- the source of the Event, most likely a this reference.descriptors
- the descriptorspublic String getID()
getID
in interface Identifiable
public String getType()
getType
in interface EventModel<Event>
public Identification getSource()
getSource
in interface EventModel<Event>
public ListResourceProvider getListResourceContainer()
getListResourceContainer
in interface EventModel<Event>
public Event addResource(ResourceModel resource)
addResource
in interface EventModel<Event>
resource
- an instance of the resource to addpublic Event addResources(List<ResourceModel> resources)
addResources
in interface EventModel<Event>
resources
- a list containing all the resourcespublic List<String> getDescriptors()
getDescriptors
in interface EventModel<Event>
public List<String> getAllInformations()
getAllInformations
in interface EventModel<Event>
public Event setDescriptors(List<String> descriptors)
Replaces all existing descriptors. Since Event is immutable, it will create a new Instance.
descriptors
- a List containing all the Descriptorspublic Event addDescriptor(String descriptor)
descriptor
- a String describing the Event.public Event replaceDescriptors(List<String> descriptors)
descriptors
- a list containing the Descriptors.public boolean containsDescriptor(String descriptor)
containsDescriptor
in interface EventModel<Event>
descriptor
- a String with the ID of the Descriptorpublic EventBehaviourControllerModel getEventBehaviourController()
getEventBehaviourController
in interface EventModel<Event>
public void lifecycleCallback(EventLifeCycle eventLifeCycle)
lifecycleCallback
in interface EventModel<Event>
public Event addEventLifeCycleListener(EventLifeCycle eventLifeCycle, java.util.function.Consumer<EventLifeCycle> cycleCallback)
eventLifeCycle
- the EventLifeCycle to targetcycleCallback
- the callbackCopyright © 2016. All rights reserved.