Class AbstractUrl
-
- All Implemented Interfaces:
-
ai.platon.pulsar.common.urls.ComparableUrlAware,ai.platon.pulsar.common.urls.UrlAware,kotlin.Comparable
public abstract class AbstractUrl implements ComparableUrlAware
An abstract url is a url with some common properties and methods.
-
-
Field Summary
Fields Modifier and Type Field Description private final StringconfiguredUrlprivate final BooleanisStandardprivate final URLtoURLprivate final URLtoURLOrNullprivate final BooleanisNilprivate final BooleanisPersistableprivate final Stringlabelprivate final Instantdeadlineprivate Stringlangprivate Stringcountryprivate Stringdistrictprivate IntegernMaxRetryprivate Stringurlprivate Stringargsprivate Stringreferrerprivate Stringhrefprivate Integerpriority
-
Method Summary
Modifier and Type Method Description StringgetConfiguredUrl()The configured url, always be "$url $args" BooleanisStandard()If true, the url is standard and can be converted to a java.net.URL URLgetToURL()Converted to a java.net.URL URLgetToURLOrNull()Converted to a java.net.URL, if the url is invalid, return null BooleanisNil()An url is Nil if it equals to AppConstants. BooleanisPersistable()If true, the url is persistable, it can be saved to the database. StringgetLabel()The url label, it should be a shortcut for -labeloption in load optionsInstantgetDeadline()The deadline, it should be a shortcut for -deadlineoption in load optionsStringgetLang()Required website language, reserved for future use UnitsetLang(String lang)Required website language, reserved for future use StringgetCountry()Required website country, reserved for future use UnitsetCountry(String country)Required website country, reserved for future use StringgetDistrict()Required website district, reserved for future use UnitsetDistrict(String district)Required website district, reserved for future use IntegergetNMaxRetry()The maximum retry times UnitsetNMaxRetry(Integer nMaxRetry)The maximum retry times StringgetUrl()The url specification, can be followed by load arguments. UnitsetUrl(String url)The url specification, can be followed by load arguments. StringgetArgs()The explicitly specified load arguments UnitsetArgs(String args)The explicitly specified load arguments StringgetReferrer()The referrer url, it is the url of the webpage that contains the hyperlink. UnitsetReferrer(String referrer)The referrer url, it is the url of the webpage that contains the hyperlink. StringgetHref()The hypertext reference, it defines the address of the document, which this time is linked from. UnitsetHref(String href)The hypertext reference, it defines the address of the document, which this time is linked from. IntegergetPriority()The priority of the url, the higher the priority, the earlier the url will be loaded. UnitsetPriority(Integer priority)The priority of the url, the higher the priority, the earlier the url will be loaded. Booleanequals(Object other)An abstract url can compare to one of the following types: IntegercompareTo(UrlAware other)IntegerhashCode()StringtoString()Stringserialize()Serialize the url to a string -
-
Method Detail
-
getConfiguredUrl
String getConfiguredUrl()
The configured url, always be "$url $args"
-
isStandard
Boolean isStandard()
If true, the url is standard and can be converted to a java.net.URL
-
getToURL
URL getToURL()
Converted to a java.net.URL
-
getToURLOrNull
URL getToURLOrNull()
Converted to a java.net.URL, if the url is invalid, return null
-
isPersistable
Boolean isPersistable()
If true, the url is persistable, it can be saved to the database. Not all urls are persistable, for example, a ListenableHyperlink with events is not persistable.
-
getDeadline
Instant getDeadline()
The deadline, it should be a shortcut for
-deadlineoption in load options
-
getCountry
String getCountry()
Required website country, reserved for future use
-
setCountry
Unit setCountry(String country)
Required website country, reserved for future use
-
getDistrict
String getDistrict()
Required website district, reserved for future use
-
setDistrict
Unit setDistrict(String district)
Required website district, reserved for future use
-
getNMaxRetry
Integer getNMaxRetry()
The maximum retry times
-
setNMaxRetry
Unit setNMaxRetry(Integer nMaxRetry)
The maximum retry times
-
getReferrer
String getReferrer()
The referrer url, it is the url of the webpage that contains the hyperlink.
-
setReferrer
Unit setReferrer(String referrer)
The referrer url, it is the url of the webpage that contains the hyperlink.
-
getHref
String getHref()
The hypertext reference, it defines the address of the document, which this time is linked from. The href is usually extracted from the webpage and serves as the browser's primary choice for navigation.
-
setHref
Unit setHref(String href)
The hypertext reference, it defines the address of the document, which this time is linked from. The href is usually extracted from the webpage and serves as the browser's primary choice for navigation.
-
getPriority
Integer getPriority()
The priority of the url, the higher the priority, the earlier the url will be loaded. Priority is a numerical value, where smaller numbers indicate higher priority.
-
setPriority
Unit setPriority(Integer priority)
The priority of the url, the higher the priority, the earlier the url will be loaded. Priority is a numerical value, where smaller numbers indicate higher priority.
-
-
-
-