Record Class TimeScript

java.lang.Object
java.lang.Record
kr.toxicity.model.api.script.TimeScript
Record Components:
time - time
script - source script
All Implemented Interfaces:
Comparable<Timed>, Consumer<ScriptSource>, Timed, AnimationScript

public record TimeScript(float time, @NotNull AnimationScript script) extends Record implements AnimationScript, Timed
Script with time
  • Field Details

  • Constructor Details

    • TimeScript

      public TimeScript(float time, @NotNull @NotNull AnimationScript script)
      Creates an instance of a TimeScript record class.
      Parameters:
      time - the value for the time record component
      script - the value for the script record component
  • Method Details

    • isSync

      public boolean isSync()
      Specified by:
      isSync in interface AnimationScript
    • accept

      public void accept(@NotNull @NotNull ScriptSource trigger)
      Specified by:
      accept in interface AnimationScript
      Specified by:
      accept in interface Consumer<ScriptSource>
    • time

      @NotNull public @NotNull TimeScript time(float time)
      Description copied from interface: AnimationScript
      Creates a timed script
      Specified by:
      time in interface AnimationScript
      Parameters:
      time - time
      Returns:
      timed script
    • equals

      public 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.
    • hashCode

      public 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
    • 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
    • time

      public float time()
      Returns the value of the time record component.
      Specified by:
      time in interface Timed
      Returns:
      the value of the time record component
    • script

      @NotNull public @NotNull AnimationScript script()
      Returns the value of the script record component.
      Returns:
      the value of the script record component