Record Class Lrc

java.lang.Object
java.lang.Record
lol.trq.orpheus.lyrics.Lrc
Record Components:
title - the ti tag, or empty
artist - the ar tag, or empty
album - the al tag, or empty
lengthMillis - the length tag, or -1
lyrics - the lines; Lyrics.NONE when the file holds none

public record Lrc(String title, String artist, String album, long lengthMillis, Lyrics lyrics) extends Record
A parsed .lrc file. The parser accepts what players write in practice and skips what it cannot read; it never throws on bad input.
  • Field Details

  • Constructor Details

    • Lrc

      public Lrc(String title, String artist, String album, long lengthMillis, Lyrics lyrics)
      Creates an instance of a Lrc record class.
      Parameters:
      title - the value for the title record component
      artist - the value for the artist record component
      album - the value for the album record component
      lengthMillis - the value for the lengthMillis record component
      lyrics - the value for the lyrics record component
  • Method Details

    • read

      public static Lrc read(byte[] data)
      Decodes and parses file content. Honours a UTF-8 or UTF-16 byte order mark; otherwise assumes UTF-8.
    • parse

      public static Lrc parse(String text)
    • 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.
    • title

      public String title()
      Returns the value of the title record component.
      Returns:
      the value of the title record component
    • artist

      public String artist()
      Returns the value of the artist record component.
      Returns:
      the value of the artist record component
    • album

      public String album()
      Returns the value of the album record component.
      Returns:
      the value of the album record component
    • lengthMillis

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

      public Lyrics lyrics()
      Returns the value of the lyrics record component.
      Returns:
      the value of the lyrics record component