Record Class PostalAddress

java.lang.Object
java.lang.Record
net.ygbstudio.jbrave.core.domain.dto.web.PostalAddress
Record Components:
type - The type of address
country - The country component of the address.
postalCode - The postal or ZIP code of the address.
streetAddress - The street address, including building number and street name.
addressRegion - The region or state component of the address.
addressLocality - The city or locality component of the address.
displayAddress - A pre-formatted, human-readable representation of the full address.

public record PostalAddress(String type, String country, String postalCode, String streetAddress, String addressRegion, String addressLocality, String displayAddress) extends Record
Represents a physical mailing address in search results. This is used in the Brave Search API to provide structured address information for locations, businesses, and other geographical entities.
  • Constructor Details

    • PostalAddress

      public PostalAddress(String type, String country, String postalCode, String streetAddress, String addressRegion, String addressLocality, String displayAddress)
      Creates an instance of a PostalAddress record class.
      Parameters:
      type - the value for the type record component
      country - the value for the country record component
      postalCode - the value for the postalCode record component
      streetAddress - the value for the streetAddress record component
      addressRegion - the value for the addressRegion record component
      addressLocality - the value for the addressLocality record component
      displayAddress - the value for the displayAddress 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.
    • type

      public String type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • country

      public String country()
      Returns the value of the country record component.
      Returns:
      the value of the country record component
    • postalCode

      public String postalCode()
      Returns the value of the postalCode record component.
      Returns:
      the value of the postalCode record component
    • streetAddress

      public String streetAddress()
      Returns the value of the streetAddress record component.
      Returns:
      the value of the streetAddress record component
    • addressRegion

      public String addressRegion()
      Returns the value of the addressRegion record component.
      Returns:
      the value of the addressRegion record component
    • addressLocality

      public String addressLocality()
      Returns the value of the addressLocality record component.
      Returns:
      the value of the addressLocality record component
    • displayAddress

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