Record Class DragonFlight

java.lang.Object
java.lang.Record
dev.itsharshxd.zentrix.api.dragon.DragonFlight

public record DragonFlight(@NotNull UUID dragonId, @NotNull org.bukkit.Location start, @NotNull org.bukkit.Location destination, @NotNull Set<UUID> passengers, @NotNull List<DragonEndpointChunk> endpointChunks, @NotNull DragonFlightStatus status, long startedAtMillis, long completedAtMillis) extends Record
Immutable route, passenger, endpoint, and lifecycle snapshot of one dragon bus.
  • Constructor Summary

    Constructors
    Constructor
    Description
    DragonFlight(@NotNull UUID dragonId, @NotNull org.bukkit.Location start, @NotNull org.bukkit.Location destination, @NotNull Set<UUID> passengers, @NotNull List<DragonEndpointChunk> endpointChunks, @NotNull DragonFlightStatus status, long startedAtMillis, long completedAtMillis)
    Creates an instance of a DragonFlight record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    boolean
     
    long
    Returns the value of the completedAtMillis record component.
    org.bukkit.Location
    Returns the value of the destination record component.
    @NotNull UUID
    Returns the value of the dragonId record component.
    Returns the value of the endpointChunks record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    @NotNull Set<UUID>
    Returns the value of the passengers record component.
    org.bukkit.Location
    Returns the value of the start record component.
    long
    Returns the value of the startedAtMillis record component.
    Returns the value of the status record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • DragonFlight

      public DragonFlight(@NotNull @NotNull UUID dragonId, @NotNull @NotNull org.bukkit.Location start, @NotNull @NotNull org.bukkit.Location destination, @NotNull @NotNull Set<UUID> passengers, @NotNull @NotNull List<DragonEndpointChunk> endpointChunks, @NotNull @NotNull DragonFlightStatus status, long startedAtMillis, long completedAtMillis)
      Creates an instance of a DragonFlight record class.
      Parameters:
      dragonId - the value for the dragonId record component
      start - the value for the start record component
      destination - the value for the destination record component
      passengers - the value for the passengers record component
      endpointChunks - the value for the endpointChunks record component
      status - the value for the status record component
      startedAtMillis - the value for the startedAtMillis record component
      completedAtMillis - the value for the completedAtMillis record component
  • Method Details

    • start

      public org.bukkit.Location start()
      Returns the value of the start record component.
      Returns:
      the value of the start record component
    • destination

      public org.bukkit.Location destination()
      Returns the value of the destination record component.
      Returns:
      the value of the destination record component
    • active

      public boolean active()
    • arrived

      public boolean arrived()
    • 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.
    • dragonId

      @NotNull public @NotNull UUID dragonId()
      Returns the value of the dragonId record component.
      Returns:
      the value of the dragonId record component
    • passengers

      @NotNull public @NotNull Set<UUID> passengers()
      Returns the value of the passengers record component.
      Returns:
      the value of the passengers record component
    • endpointChunks

      @NotNull public @NotNull List<DragonEndpointChunk> endpointChunks()
      Returns the value of the endpointChunks record component.
      Returns:
      the value of the endpointChunks record component
    • status

      @NotNull public @NotNull DragonFlightStatus status()
      Returns the value of the status record component.
      Returns:
      the value of the status record component
    • startedAtMillis

      public long startedAtMillis()
      Returns the value of the startedAtMillis record component.
      Returns:
      the value of the startedAtMillis record component
    • completedAtMillis

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