Package org.pkl.core.project
Record Class CanonicalPackageUri
java.lang.Object
java.lang.Record
org.pkl.core.project.CanonicalPackageUri
The canonical name of a package dependency within a project.
Equivalent to the package's base URI, and the major version number, i.e.
package://example.com/foo/bar@0. Does not include a URI's userinfo, query params or fragment
segments.
-
Constructor Summary
ConstructorsConstructorDescriptionCanonicalPackageUri(URI baseUri, int majorVersion) Creates an instance of aCanonicalPackageUrirecord class. -
Method Summary
Modifier and TypeMethodDescriptionbaseUri()Returns the value of thebaseUrirecord component.booleanIndicates whether some other object is "equal to" this one.static CanonicalPackageUrifromPackageUri(PackageUri packageUri) Deprecated, for removal: This API element is subject to removal in a future version.intDeprecated, for removal: This API element is subject to removal in a future version.As of 0.28.0, replaced bymajorVersion().final inthashCode()Returns a hash code value for this object.intReturns the value of themajorVersionrecord component.static CanonicalPackageUritoString()Returns a string representation of this record class.
-
Constructor Details
-
CanonicalPackageUri
Creates an instance of aCanonicalPackageUrirecord class.- Parameters:
baseUri- the value for thebaseUrirecord componentmajorVersion- the value for themajorVersionrecord component
-
-
Method Details
-
fromPackageUri
-
of
- Throws:
URISyntaxException
-
getMajorVersion
Deprecated, for removal: This API element is subject to removal in a future version.As of 0.28.0, replaced bymajorVersion(). -
getBaseUri
Deprecated, for removal: This API element is subject to removal in a future version.As of 0.28.0, replaced bybaseUri(). -
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 '=='. -
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. -
baseUri
Returns the value of thebaseUrirecord component.- Returns:
- the value of the
baseUrirecord component
-
majorVersion
public int majorVersion()Returns the value of themajorVersionrecord component.- Returns:
- the value of the
majorVersionrecord component
-
baseUri().