Package org.pkl.core.resource
Record Class Resource
java.lang.Object
java.lang.Record
org.pkl.core.resource.Resource
An external (file, HTTP, etc.) resource.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]bytes()Returns the value of thebytesrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the content of this resource in Base64.byte[]getBytes()Deprecated, for removal: This API element is subject to removal in a future version.getText()Returns the text content of this resource.getUri()Deprecated, for removal: This API element is subject to removal in a future version.As of 0.28.0, replaced byuri()final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.uri()Returns the value of theurirecord component.
-
Constructor Details
-
Resource
Creates an instance of aResourcerecord class.- Parameters:
uri- the value for theurirecord componentbytes- the value for thebytesrecord component
-
-
Method Details
-
getUri
Deprecated, for removal: This API element is subject to removal in a future version.As of 0.28.0, replaced byuri() -
getBytes
Deprecated, for removal: This API element is subject to removal in a future version.As of 0.28.0, replaced bybytes() -
getText
Returns the text content of this resource. -
getBase64
Returns the content of this resource in Base64. -
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. All components in this record class are compared withObjects::equals(Object,Object). -
uri
Returns the value of theurirecord component.- Returns:
- the value of the
urirecord component
-
bytes
public byte[] bytes()Returns the value of thebytesrecord component.- Returns:
- the value of the
bytesrecord component
-
bytes()