Record Class DictionaryCatalog.Entry

java.lang.Object
java.lang.Record
opennlp.tools.util.DictionaryCatalog.Entry
Record Components:
id - The catalog id.
uri - The absolute download URI.
sha512 - The expected SHA-512 hex digest.
filename - An optional preferred local file name; may be null.
Enclosing class:
DictionaryCatalog

public static record DictionaryCatalog.Entry(String id, URI uri, String sha512, String filename) extends Record
One catalog entry with a URI and the SHA-512 digest of its bytes.
Since:
3.0.0
  • Constructor Summary

    Constructors
    Constructor
    Description
    Entry(String id, URI uri, String sha512, String filename)
    Validates the components.
  • Method Summary

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

    Methods inherited from class Object

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

    • Entry

      public Entry(String id, URI uri, String sha512, String filename)
      Validates the components.
      Parameters:
      id - The catalog id. Must not be null.
      uri - The absolute download URI. Must not be null.
      sha512 - The expected SHA-512 hex digest. Must not be null.
      filename - An optional preferred local file name; may be null.
      Throws:
      IllegalArgumentException - Thrown if a required value is null, uri is relative, sha512 is not 128 hex digits, or filename is not a local file name.
  • 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.
    • id

      public String id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • uri

      public URI uri()
      Returns the value of the uri record component.
      Returns:
      the value of the uri record component
    • sha512

      public String sha512()
      Returns the value of the sha512 record component.
      Returns:
      the value of the sha512 record component
    • filename

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