Record Class FileLink

java.lang.Object
java.lang.Record
org.ek9lang.cli.coverage.model.FileLink
Record Components:
start - The opening part of the link text before the line number
end - The closing part of the link text after the line number
href - The href attribute value for the anchor tag

public record FileLink(String start, String end, String href) extends Record
File link parts for generating HTML hyperlinks to source file locations. Used to construct links to specific lines in source file coverage views.
  • Constructor Summary

    Constructors
    Constructor
    Description
    FileLink(String start, String end, String href)
    Creates an instance of a FileLink record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    end()
    Returns the value of the end record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    boolean
    Check if this represents an actual link or just plain text.
    Returns the value of the href record component.
    static FileLink
    Create a FileLink with no link (plain text display).
    Returns the value of the start record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • FileLink

      public FileLink(String start, String end, String href)
      Creates an instance of a FileLink record class.
      Parameters:
      start - the value for the start record component
      end - the value for the end record component
      href - the value for the href record component
  • Method Details

    • plainText

      public static FileLink plainText(String text)
      Create a FileLink with no link (plain text display).
      Parameters:
      text - The plain text to display
      Returns:
      A FileLink with empty href indicating no link
    • hasLink

      public boolean hasLink()
      Check if this represents an actual link or just plain text.
      Returns:
      true if this has a valid href for linking
    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • start

      public String start()
      Returns the value of the start record component.
      Returns:
      the value of the start record component
    • end

      public String end()
      Returns the value of the end record component.
      Returns:
      the value of the end record component
    • href

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