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.

public record ScheduledEvent(String eventName, List<Object> args, long endTime) extends Record
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 Details

    • ScheduledEvent

      public ScheduledEvent(String eventName, List<Object> args, long endTime)
      Creates an instance of a ScheduledEvent record class.
      Parameters:
      eventName - the value for the eventName record component
      args - the value for the args record component
      endTime - the value for the endTime record component
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • eventName

      public String eventName()
      Returns the value of the eventName record component.
      Returns:
      the value of the eventName record component
    • args

      public List<Object> args()
      Returns the value of the args record component.
      Returns:
      the value of the args record component
    • endTime

      public long endTime()
      Returns the value of the endTime record component.
      Returns:
      the value of the endTime record component