Package dev.enola.common.io.metadata
Record Class Metadata
java.lang.Object
java.lang.Record
dev.enola.common.io.metadata.Metadata
- Record Components:
iri- IRI about which this is Metadata.imageHTML- HTML of an image for the IRI, e.g. <img...> with URL of a favicon or something like that; or an 😃 Emoji!Always returns something (never null), but may be empty String.
imageURL- URL (not HTML) of an image for the IRI, but never the 😃 Emoji.Always returns something (never null), but may be empty String.
emoji- An 😃 Emoji for the IRI, as String (not URL or HTML).Always returns something (never null), but may be empty String.
curie- An IRI converted to a "CURIE" (e.g. rdfs:Class), if available.Always returns something (never null), but may be empty String if no suitable CURIE could be determined.
label- Short human-readable 🏷️ label, as text; e.g. TITLE of HTML page found at the IRI.Always returns text (never empty), but may fallback to e.g. last part of IRI.
descriptionHTML- Longer human-readable 📜 description, as HTML.E.g. first paragraph or < meta ... description > of a HTML page.
Always returns something (never null), but may be empty String.
@Immutable
public record Metadata(String iri, String imageHTML, String imageURL, String emoji, String curie, String label, String descriptionHTML)
extends Record
Metadata of an IRI, provided by
MetadataProvider.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncurie()Returns the value of thecurierecord component.Returns the value of thedescriptionHTMLrecord component.emoji()Returns the value of theemojirecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theimageHTMLrecord component.imageURL()Returns the value of theimageURLrecord component.iri()Returns the value of theirirecord component.label()Returns the value of thelabelrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
IRI_Comparator
-
-
Constructor Details
-
Metadata
public Metadata(String iri, String imageHTML, String imageURL, String emoji, String curie, String label, String descriptionHTML) Creates an instance of aMetadatarecord class.- Parameters:
iri- the value for theirirecord componentimageHTML- the value for theimageHTMLrecord componentimageURL- the value for theimageURLrecord componentemoji- the value for theemojirecord componentcurie- the value for thecurierecord componentlabel- the value for thelabelrecord componentdescriptionHTML- the value for thedescriptionHTMLrecord component
-
-
Method Details
-
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
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). -
iri
Returns the value of theirirecord component.- Returns:
- the value of the
irirecord component
-
imageHTML
Returns the value of theimageHTMLrecord component.- Returns:
- the value of the
imageHTMLrecord component
-
imageURL
Returns the value of theimageURLrecord component.- Returns:
- the value of the
imageURLrecord component
-
emoji
Returns the value of theemojirecord component.- Returns:
- the value of the
emojirecord component
-
curie
Returns the value of thecurierecord component.- Returns:
- the value of the
curierecord component
-
label
Returns the value of thelabelrecord component.- Returns:
- the value of the
labelrecord component
-
descriptionHTML
Returns the value of thedescriptionHTMLrecord component.- Returns:
- the value of the
descriptionHTMLrecord component
-