Record Class ClockTimeMarkerImpl

java.lang.Object
java.lang.Record
net.minestom.server.world.clock.ClockTimeMarkerImpl
All Implemented Interfaces:
ClockTimeMarker

public record ClockTimeMarkerImpl(RegistryKey<WorldClock> clock, int ticks, @Nullable Integer periodTicks, boolean showInCommands) extends Record implements ClockTimeMarker
  • Field Details

  • Constructor Details

    • ClockTimeMarkerImpl

      public ClockTimeMarkerImpl(RegistryKey<WorldClock> clock, int ticks, @Nullable @Nullable Integer periodTicks, boolean showInCommands)
      Creates an instance of a ClockTimeMarkerImpl record class.
      Parameters:
      clock - the value for the clock record component
      ticks - the value for the ticks record component
      periodTicks - the value for the periodTicks record component
      showInCommands - the value for the showInCommands 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 the compare method from their corresponding wrapper classes.
      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.
    • clock

      public RegistryKey<WorldClock> clock()
      Returns the value of the clock record component.
      Specified by:
      clock in interface ClockTimeMarker
      Returns:
      the value of the clock record component
    • ticks

      public int ticks()
      Returns the value of the ticks record component.
      Specified by:
      ticks in interface ClockTimeMarker
      Returns:
      the value of the ticks record component
    • periodTicks

      @Nullable public @Nullable Integer periodTicks()
      Returns the value of the periodTicks record component.
      Specified by:
      periodTicks in interface ClockTimeMarker
      Returns:
      the value of the periodTicks record component
    • showInCommands

      public boolean showInCommands()
      Returns the value of the showInCommands record component.
      Specified by:
      showInCommands in interface ClockTimeMarker
      Returns:
      the value of the showInCommands record component