Package org.opentcs.data
Class ObjectHistory.Entry
java.lang.Object
org.opentcs.data.ObjectHistory.Entry
- All Implemented Interfaces:
java.io.Serializable
- Enclosing class:
- ObjectHistory
public static class ObjectHistory.Entry
extends java.lang.Object
implements java.io.Serializable
An entry/event in a history.
- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description Entry(java.lang.String eventCode)
Creates a new instance with the timestamp set to the current point of time and an empty supplement.Entry(java.lang.String eventCode, java.lang.Object supplement)
Creates a new instance with the timestamp set to the current point of time.Entry(java.time.Instant timestamp, java.lang.String eventCode)
Creates a new instance with an empty supplement.Entry(java.time.Instant timestamp, java.lang.String eventCode, java.lang.Object supplement)
Creates a new instance. -
Method Summary
Modifier and Type Method Description java.lang.String
getEventCode()
Returns this entry's event code.java.lang.Object
getSupplement()
Returns a supplemental object providing details about the event.java.time.Instant
getTimestamp()
Returns this entry's timestamp.java.lang.String
toString()
-
Constructor Details
-
Entry
public Entry(java.time.Instant timestamp, java.lang.String eventCode, java.lang.Object supplement)Creates a new instance.- Parameters:
timestamp
- The point of time at which the event occured.eventCode
- A code identifying the event that occured.supplement
- Supplementary information about the event. Must beSerializable
and should provide a human-readable default representation from itstoString()
method.
-
Entry
public Entry(java.time.Instant timestamp, java.lang.String eventCode)Creates a new instance with an empty supplement.- Parameters:
timestamp
- The point of time at which the event occured.eventCode
- A code identifying the event that occured.
-
Entry
public Entry(java.lang.String eventCode, java.lang.Object supplement)Creates a new instance with the timestamp set to the current point of time.- Parameters:
eventCode
- A code identifying the event that occured.supplement
- Supplementary information about the event. Must beSerializable
and should provide a human-readable default representation from itstoString()
method.
-
Entry
public Entry(java.lang.String eventCode)Creates a new instance with the timestamp set to the current point of time and an empty supplement.- Parameters:
eventCode
- A code identifying the event that occured.
-
-
Method Details
-
getTimestamp
@Nonnull public java.time.Instant getTimestamp()Returns this entry's timestamp.- Returns:
- This entry's timestamp.
-
getEventCode
@Nonnull public java.lang.String getEventCode()Returns this entry's event code.- Returns:
- This entry's event code.
-
getSupplement
@Nonnull public java.lang.Object getSupplement()Returns a supplemental object providing details about the event.- Returns:
- A supplemental object providing details about the event.
-
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-