Package com.csse3200.game.events
Record Class ScheduledEvent
java.lang.Object
java.lang.Record
com.csse3200.game.events.ScheduledEvent
- Record Components:
eventName
- The name of the event.args
- A list of arguments to be passed when the event is triggered.endTime
- The time at which the event is scheduled to be triggered.
Represents a scheduled event with associated information.
A scheduled event is an event that is scheduled to occur at a specific time in the future, and it may carry a list of arguments to be passed when the event is triggered.
-
Constructor Summary
ConstructorsConstructorDescriptionScheduledEvent
(String eventName, List<Object> args, long endTime) Creates an instance of aScheduledEvent
record class. -
Method Summary
Modifier and TypeMethodDescriptionargs()
Returns the value of theargs
record component.long
endTime()
Returns the value of theendTime
record component.final boolean
Indicates whether some other object is "equal to" this one.Returns the value of theeventName
record component.final int
hashCode()
Returns a hash code value for this object.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
eventName
Returns the value of theeventName
record component.- Returns:
- the value of the
eventName
record component
-
args
Returns the value of theargs
record component.- Returns:
- the value of the
args
record component
-
endTime
public long endTime()Returns the value of theendTime
record component.- Returns:
- the value of the
endTime
record component
-