Record Class SitemapEntry

java.lang.Object
java.lang.Record
com.endurancetrio.business.common.dto.SitemapEntry
Record Components:
urlEn - the absolute URL of the English variant (must be non-null and non-blank)
urlPt - the absolute URL of the Portuguese variant (must be non-null and non-blank)
lastModified - the ISO-8601 date the page was last modified, or null when unknown
priority - the sitemap priority of the page, between 0.0 and 1.0

public record SitemapEntry(String urlEn, String urlPt, String lastModified, double priority) extends Record
SitemapEntry represents a single <url> element of the generated /sitemap.xml, pairing the English and Portuguese variants of the same page so the sitemap template can emit hreflang annotations.
  • Constructor Details

    • SitemapEntry

      public SitemapEntry(String urlEn, String urlPt, String lastModified, double priority)
      Creates an instance of a SitemapEntry record class.
      Parameters:
      urlEn - the value for the urlEn record component
      urlPt - the value for the urlPt record component
      lastModified - the value for the lastModified record component
      priority - the value for the priority 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • urlEn

      public String urlEn()
      Returns the value of the urlEn record component.
      Returns:
      the value of the urlEn record component
    • urlPt

      public String urlPt()
      Returns the value of the urlPt record component.
      Returns:
      the value of the urlPt record component
    • lastModified

      public String lastModified()
      Returns the value of the lastModified record component.
      Returns:
      the value of the lastModified record component
    • priority

      public double priority()
      Returns the value of the priority record component.
      Returns:
      the value of the priority record component