Record Class SuccessResultPage

java.lang.Object
java.lang.Record
org.jweaver.crawler.internal.result.SuccessResultPage
Record Components:
uri - page URI
title - document title
content - document content
linkSet - child links on the page
metadata - collected metadata of the page
depth - current depth
All Implemented Interfaces:
ResultPage

public record SuccessResultPage(String uri, String title, String content, Set<PageLink> linkSet, Metadata metadata, int depth) extends Record implements ResultPage
The SuccessResultPage record represents a successful result page obtained during web crawling. It includes information such as the URI, title, content, links, metadata, and depth of the page. This record implements the ResultPage interface.
  • Constructor Details

    • SuccessResultPage

      public SuccessResultPage(String uri, String title, String content, Set<PageLink> linkSet, Metadata metadata, int depth)
      Creates an instance of a SuccessResultPage record class.
      Parameters:
      uri - the value for the uri record component
      title - the value for the title record component
      content - the value for the content record component
      linkSet - the value for the linkSet record component
      metadata - the value for the metadata record component
      depth - the value for the depth record component
  • Method Details

    • create

      public static SuccessResultPage create(PageLink pageLink, String title, String content, Set<PageLink> linkSet)
      Creates a SuccessResultPage instance based on the provided PageLink, title, content, and link set.
      Parameters:
      pageLink - The PageLink representing the URI and depth of the result page.
      title - The title of the result page.
      content - The content of the result page.
      linkSet - The set of links found in the result page.
      Returns:
      A SuccessResultPage instance.
    • 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.
    • uri

      public String uri()
      Returns the value of the uri record component.
      Specified by:
      uri in interface ResultPage
      Returns:
      the value of the uri record component
    • title

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

      public String content()
      Returns the value of the content record component.
      Specified by:
      content in interface ResultPage
      Returns:
      the value of the content record component
    • linkSet

      public Set<PageLink> linkSet()
      Returns the value of the linkSet record component.
      Returns:
      the value of the linkSet record component
    • metadata

      public Metadata metadata()
      Returns the value of the metadata record component.
      Returns:
      the value of the metadata record component
    • depth

      public int depth()
      Returns the value of the depth record component.
      Returns:
      the value of the depth record component