Record Class Path.EventTrigger

java.lang.Object
java.lang.Record
frc.robot.lib.BLine.Path.EventTrigger
Record Components:
t_ratio - The position along the segment (0-1) where this event should trigger
libKey - The key used to look up the registered action
All Implemented Interfaces:
Path.PathElement
Enclosing class:
Path

public static record Path.EventTrigger(double t_ratio, String libKey) extends Record implements Path.PathElement
An event trigger that fires a user-registered action at a t_ratio along a segment.

Event triggers are placed between translation targets and use their t_ratio to determine when the action should fire along the segment.

  • Constructor Details

    • EventTrigger

      public EventTrigger(double t_ratio, String libKey)
      Creates an instance of a EventTrigger record class.
      Parameters:
      t_ratio - the value for the t_ratio record component
      libKey - the value for the libKey record component
  • Method Details

    • copy

      public Path.EventTrigger copy()
      Creates a copy of this event trigger.
      Specified by:
      copy in interface Path.PathElement
      Returns:
      A new EventTrigger with the same values
    • 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.
    • t_ratio

      public double t_ratio()
      Returns the value of the t_ratio record component.
      Returns:
      the value of the t_ratio record component
    • libKey

      public String libKey()
      Returns the value of the libKey record component.
      Returns:
      the value of the libKey record component