Record Class SuccessResultPage
java.lang.Object
java.lang.Record
org.jweaver.crawler.internal.result.SuccessResultPage
- Record Components:
uri- page URItitle- document titlecontent- document contentlinkSet- child links on the pagemetadata- collected metadata of the pagedepth- 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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncontent()Returns the value of thecontentrecord component.static SuccessResultPageCreates a SuccessResultPage instance based on the provided PageLink, title, content, and link set.intdepth()Returns the value of thedepthrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.linkSet()Returns the value of thelinkSetrecord component.metadata()Returns the value of themetadatarecord component.title()Returns the value of thetitlerecord component.final StringtoString()Returns a string representation of this record class.uri()Returns the value of theurirecord component.
-
Constructor Details
-
SuccessResultPage
public SuccessResultPage(String uri, String title, String content, Set<PageLink> linkSet, Metadata metadata, int depth) Creates an instance of aSuccessResultPagerecord class.- Parameters:
uri- the value for theurirecord componenttitle- the value for thetitlerecord componentcontent- the value for thecontentrecord componentlinkSet- the value for thelinkSetrecord componentmetadata- the value for themetadatarecord componentdepth- the value for thedepthrecord 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
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
uri
Returns the value of theurirecord component.- Specified by:
uriin interfaceResultPage- Returns:
- the value of the
urirecord component
-
title
Returns the value of thetitlerecord component.- Returns:
- the value of the
titlerecord component
-
content
Returns the value of thecontentrecord component.- Specified by:
contentin interfaceResultPage- Returns:
- the value of the
contentrecord component
-
linkSet
Returns the value of thelinkSetrecord component.- Returns:
- the value of the
linkSetrecord component
-
metadata
Returns the value of themetadatarecord component.- Returns:
- the value of the
metadatarecord component
-
depth
public int depth()Returns the value of thedepthrecord component.- Returns:
- the value of the
depthrecord component
-