Record Class PostalAddress
java.lang.Object
java.lang.Record
net.ygbstudio.jbrave.core.domain.dto.web.PostalAddress
- Record Components:
type- The type of addresscountry- 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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theaddressLocalityrecord component.Returns the value of theaddressRegionrecord component.country()Returns the value of thecountryrecord component.Returns the value of thedisplayAddressrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thepostalCoderecord component.Returns the value of thestreetAddressrecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
PostalAddress
public PostalAddress(String type, String country, String postalCode, String streetAddress, String addressRegion, String addressLocality, String displayAddress) Creates an instance of aPostalAddressrecord class.- Parameters:
type- the value for thetyperecord componentcountry- the value for thecountryrecord componentpostalCode- the value for thepostalCoderecord componentstreetAddress- the value for thestreetAddressrecord componentaddressRegion- the value for theaddressRegionrecord componentaddressLocality- the value for theaddressLocalityrecord componentdisplayAddress- the value for thedisplayAddressrecord component
-
-
Method Details
-
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. -
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. -
equals
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 withObjects::equals(Object,Object). -
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
country
Returns the value of thecountryrecord component.- Returns:
- the value of the
countryrecord component
-
postalCode
Returns the value of thepostalCoderecord component.- Returns:
- the value of the
postalCoderecord component
-
streetAddress
Returns the value of thestreetAddressrecord component.- Returns:
- the value of the
streetAddressrecord component
-
addressRegion
Returns the value of theaddressRegionrecord component.- Returns:
- the value of the
addressRegionrecord component
-
addressLocality
Returns the value of theaddressLocalityrecord component.- Returns:
- the value of the
addressLocalityrecord component
-
displayAddress
Returns the value of thedisplayAddressrecord component.- Returns:
- the value of the
displayAddressrecord component
-