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
-
Method Summary
Modifier and TypeMethodDescriptioncontent()
Returns the value of thecontent
record component.static SuccessResultPage
Creates a SuccessResultPage instance based on the provided PageLink, title, content, and link set.int
depth()
Returns the value of thedepth
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.linkSet()
Returns the value of thelinkSet
record component.metadata()
Returns the value of themetadata
record component.title()
Returns the value of thetitle
record component.final String
toString()
Returns a string representation of this record class.uri()
Returns the value of theuri
record component.
-
Constructor Details
-
SuccessResultPage
public SuccessResultPage(String uri, String title, String content, Set<PageLink> linkSet, Metadata metadata, int depth) Creates an instance of aSuccessResultPage
record class.- Parameters:
uri
- the value for theuri
record componenttitle
- the value for thetitle
record componentcontent
- the value for thecontent
record componentlinkSet
- the value for thelinkSet
record componentmetadata
- the value for themetadata
record componentdepth
- the value for thedepth
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
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 theuri
record component.- Specified by:
uri
in interfaceResultPage
- Returns:
- the value of the
uri
record component
-
title
Returns the value of thetitle
record component.- Returns:
- the value of the
title
record component
-
content
Returns the value of thecontent
record component.- Specified by:
content
in interfaceResultPage
- Returns:
- the value of the
content
record component
-
linkSet
Returns the value of thelinkSet
record component.- Returns:
- the value of the
linkSet
record component
-
metadata
Returns the value of themetadata
record component.- Returns:
- the value of the
metadata
record component
-
depth
public int depth()Returns the value of thedepth
record component.- Returns:
- the value of the
depth
record component
-