Record Class ControlRequest

java.lang.Object
java.lang.Record
lol.trq.orpheus.source.ControlRequest
Record Components:
sessionId - the target session
control - the command
positionMillis - the target for Control.SEEK
value - the target for Control.RATE and Control.VOLUME
on - the target for Control.SHUFFLE and Control.MUTE
repeat - the target for Control.REPEAT

public record ControlRequest(String sessionId, Control control, long positionMillis, double value, boolean on, Repeat repeat) extends Record
A command for one session. Only the field that belongs to the control is meaningful.
  • Constructor Details

    • ControlRequest

      public ControlRequest(String sessionId, Control control, long positionMillis, double value, boolean on, Repeat repeat)
      Creates an instance of a ControlRequest record class.
      Parameters:
      sessionId - the value for the sessionId record component
      control - the value for the control record component
      positionMillis - the value for the positionMillis record component
      value - the value for the value record component
      on - the value for the on record component
      repeat - the value for the repeat record component
  • Method Details

    • of

      public static ControlRequest of(String sessionId, Control control)
    • 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.
    • sessionId

      public String sessionId()
      Returns the value of the sessionId record component.
      Returns:
      the value of the sessionId record component
    • control

      public Control control()
      Returns the value of the control record component.
      Returns:
      the value of the control record component
    • positionMillis

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

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

      public boolean on()
      Returns the value of the on record component.
      Returns:
      the value of the on record component
    • repeat

      public Repeat repeat()
      Returns the value of the repeat record component.
      Returns:
      the value of the repeat record component