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 Details

  • Constructor Details

    • Metadata

      public Metadata(String iri, String imageHTML, String imageURL, String emoji, String curie, String label, String descriptionHTML)
      Creates an instance of a Metadata record class.
      Parameters:
      iri - the value for the iri record component
      imageHTML - the value for the imageHTML record component
      imageURL - the value for the imageURL record component
      emoji - the value for the emoji record component
      curie - the value for the curie record component
      label - the value for the label record component
      descriptionHTML - the value for the descriptionHTML record component
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • iri

      public String iri()
      Returns the value of the iri record component.
      Returns:
      the value of the iri record component
    • imageHTML

      public String imageHTML()
      Returns the value of the imageHTML record component.
      Returns:
      the value of the imageHTML record component
    • imageURL

      public String imageURL()
      Returns the value of the imageURL record component.
      Returns:
      the value of the imageURL record component
    • emoji

      public String emoji()
      Returns the value of the emoji record component.
      Returns:
      the value of the emoji record component
    • curie

      public String curie()
      Returns the value of the curie record component.
      Returns:
      the value of the curie record component
    • label

      public String label()
      Returns the value of the label record component.
      Returns:
      the value of the label record component
    • descriptionHTML

      Returns the value of the descriptionHTML record component.
      Returns:
      the value of the descriptionHTML record component