Package org.opentcs.data
Class TCSObjectEvent
java.lang.Object
org.opentcs.data.TCSObjectEvent
- All Implemented Interfaces:
Serializable
Instances of this class represent events emitted by/for business objects.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Indicates the type of an event, which can be helpful with filtering events. -
Constructor Summary
ConstructorsConstructorDescriptionTCSObjectEvent
(TCSObject<?> currentObjectState, TCSObject<?> previousObjectState, TCSObjectEvent.Type eventType) Creates a new TCSObjectEvent. -
Method Summary
Modifier and TypeMethodDescriptionTCSObject
<?> Returns the current state of the object for which this event was created.TCSObject
<?> Returns the current state of the object for which this event was created, or, if the current state isnull
, the previous state.TCSObject
<?> Returns the previous state of the object for which this event was created.getType()
Returns this event's type.toString()
-
Constructor Details
-
TCSObjectEvent
public TCSObjectEvent(TCSObject<?> currentObjectState, TCSObject<?> previousObjectState, TCSObjectEvent.Type eventType) Creates a new TCSObjectEvent.- Parameters:
currentObjectState
- The current state of the object for which this event was created. Value is irrelevant/may benull
ifeventType
isOBJECT_REMOVED
.previousObjectState
- The previous state of the object for which this event was created.Value is irrelevant/may benull
ifeventType
isOBJECT_CREATED
.eventType
- The event's type.- Throws:
NullPointerException
- IfeventType
isnull
.IllegalArgumentException
- If eithercurrentObjectState
orpreviousObjectState
isnull
whileeventType
does not have an appropriate value.
-
-
Method Details
-
getCurrentObjectState
Returns the current state of the object for which this event was created.- Returns:
- The current state of the object for which this event was created.
-
getPreviousObjectState
Returns the previous state of the object for which this event was created.- Returns:
- The previous state of the object for which this event was created.
-
getCurrentOrPreviousObjectState
Returns the current state of the object for which this event was created, or, if the current state isnull
, the previous state.- Returns:
- The current or the previous state of the object for which this event was created.
-
getType
Returns this event's type.- Returns:
- This event's type.
-
toString
-