public interface Event extends Cloneable, Serializable, HasPriority<Event>, Descriptive, HasFeatures
| Modifier and Type | Method and Description |
|---|---|
void |
addFeature(String name,
Object value)
Adds a new event feature.
|
void |
addFeatures(Map<String,Object> features)
Adds event features.
|
Event |
clone()
Clones this event.
|
boolean |
equalsByAttributes(Event event)
Compares events by attributes.
|
boolean |
equalsById(Event event)
Compares events by ID.
|
<T> T |
get(Class<T> cls,
String name)
Returns the attribute value or throws
IllegalArgumentException if it does't exist. |
<T> T |
get(String name)
Returns the attribute value or throws
IllegalArgumentException if it does't exist. |
<T> T |
get(String name,
T defaultValue)
Returns the attribute value or
defaultValue if it does't exist. |
Map<String,Object> |
getAll()
Returns the attribute map.
|
String |
getId()
Returns the event ID.
|
String |
getName()
Returns the event name.
|
Instant |
getTime()
Returns the event time.
|
boolean |
has(String name)
Checks whether this event has an attribute with the specified name.
|
Event |
set(Map<String,Object> attributes)
Sets attributes.
|
Event |
set(String name,
Object value)
Sets attribute value.
|
void |
setId(String id)
Sets the event ID.
|
void |
setTime(Instant time)
Sets the event time.
|
getPrioritygetDescription, getLabel, setDescription, setLabel, setNamegetFeatures, setFeaturesString getName()
getName in interface DescriptiveInstant getTime()
void setTime(Instant time)
time - the event time.String getId()
void setId(String id)
id - the event ID.<T> T get(String name)
IllegalArgumentException if it does't exist.T - attribute.name - the attribute name.<T> T get(Class<T> cls, String name)
IllegalArgumentException if it does't exist.T - attribute.cls - the attribute class.name - the attribute name.<T> T get(String name, T defaultValue)
defaultValue if it does't exist.T - attribute.name - the attribute name.defaultValue - the default value.Event set(String name, Object value)
name - the attribute name.value - the attribute value.Event set(Map<String,Object> attributes)
attributes - the attributes as the map.boolean has(String name)
name - the attribute name.true if there is such attribute.void addFeature(String name, Object value)
name - the feature name.value - the feature value.void addFeatures(Map<String,Object> features)
features - the features.boolean equalsById(Event event)
event - the compared event.true if both events are equal by ID.boolean equalsByAttributes(Event event)
event - the compared event.true if both events are equal by attributes.Event clone()
Copyright © 2016–2020 Softelnet. All rights reserved.