Package net.solarnetwork.event
Class BasicAppEvent
java.lang.Object
net.solarnetwork.event.BasicAppEvent
- All Implemented Interfaces:
AppEvent
Basic immutable
AppEvent.- Since:
- 2.0
- Version:
- 1.0
- Author:
- matt
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionBasicAppEvent(String topic, Instant created, Map<String, ?> eventProperties) Constructor.BasicAppEvent(String topic, Map<String, ?> eventProperties) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic BasicAppEvent.Builderbuilder()Creates builder to buildBasicAppEvent.booleanGet the date the event was created.Get the properties of the event.getTopic()Get the event topic.inthashCode()Get a builder, populated with this instance's values.toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.solarnetwork.event.AppEvent
containsProperty, getProperty, getProperty, getPropertyNames
-
Constructor Details
-
BasicAppEvent
Constructor.The event creation date will be set to the current time.
- Parameters:
topic- the event topiceventProperties- the event properties, or null- Throws:
IllegalArgumentException- iftopicis null
-
BasicAppEvent
Constructor.- Parameters:
topic- the event topiccreated- the event creation date, or null to use the current timeeventProperties- the event properties, or null- Throws:
IllegalArgumentException- iftopicis null or empty
-
-
Method Details
-
hashCode
public int hashCode() -
equals
-
toString
-
builder
Creates builder to buildBasicAppEvent.- Returns:
- created builder
-
getTopic
Description copied from interface:AppEventGet the event topic.By convention topics are path-like structures like datum/agg/calculated.
-
getCreated
Description copied from interface:AppEventGet the date the event was created.- Specified by:
getCreatedin interfaceAppEvent- Returns:
- the creation date, never null
-
getEventProperties
Description copied from interface:AppEventGet the properties of the event.The available properties is topic-specific.
- Specified by:
getEventPropertiesin interfaceAppEvent- Returns:
- the event properties, never null
-
toBuilder
Get a builder, populated with this instance's values.- Returns:
- a pre-populated builder
-