Record Class Literal

java.lang.Object
java.lang.Record
dev.enola.thing.Literal
Record Components:
value - the string value of the literal
datatypeIRI - the IRI of the datatype of the literal

@Immutable @Deprecated public record Literal(String value, String datatypeIRI) extends Record
Deprecated.
Literal is a value with datatype (IRI) which can appear in the PredicatesObjects.properties() Map values.

Normally, values are some other native Java object; this is only for cases which could not be decoded to a more suitable Java type, because no Datatype for this literal's datatype IRI was registered.

This is a LEGACY type which (now) overlaps with PredicatesObjects.datatype(String predicateIRI) (and a String value property). Prefer using that than this, which will eventually be removed.

  • Constructor Summary

    Constructors
    Constructor
    Description
    Literal(String value, String datatypeIRI)
    Deprecated.
    Creates an instance of a Literal record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Deprecated.
    Returns the value of the datatypeIRI record component.
    final boolean
    Deprecated.
    Indicates whether some other object is "equal to" this one.
    final int
    Deprecated.
    Returns a hash code value for this object.
    final String
    Deprecated.
    Returns a string representation of this record class.
    Deprecated.
    Returns the value of the value record component.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Literal

      public Literal(String value, String datatypeIRI)
      Deprecated.
      Creates an instance of a Literal record class.
      Parameters:
      value - the value for the value record component
      datatypeIRI - the value for the datatypeIRI record component
  • Method Details

    • toString

      public final String toString()
      Deprecated.
      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()
      Deprecated.
      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)
      Deprecated.
      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.
    • value

      public String value()
      Deprecated.
      Returns the value of the value record component.
      Returns:
      the value of the value record component
    • datatypeIRI

      public String datatypeIRI()
      Deprecated.
      Returns the value of the datatypeIRI record component.
      Returns:
      the value of the datatypeIRI record component