Record Class PlaceResults.StructuredAddress

java.lang.Object
java.lang.Record
org.localify.dto.geocoding.PlaceResults.StructuredAddress
Record Components:
administrativeArea - The administrative area (e.g., state).
administrativeAreaCode - The administrative area code (e.g., state code).
locality - The locality (e.g., city).
subLocality - The sub-locality.
Enclosing class:
PlaceResults

public static record PlaceResults.StructuredAddress(String administrativeArea, String administrativeAreaCode, String locality, String subLocality) extends Record
Represents a structured address.
  • Constructor Details

    • StructuredAddress

      public StructuredAddress(String administrativeArea, String administrativeAreaCode, String locality, String subLocality)
      Creates an instance of a StructuredAddress record class.
      Parameters:
      administrativeArea - the value for the administrativeArea record component
      administrativeAreaCode - the value for the administrativeAreaCode record component
      locality - the value for the locality record component
      subLocality - the value for the subLocality 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.
    • administrativeArea

      public String administrativeArea()
      Returns the value of the administrativeArea record component.
      Returns:
      the value of the administrativeArea record component
    • administrativeAreaCode

      public String administrativeAreaCode()
      Returns the value of the administrativeAreaCode record component.
      Returns:
      the value of the administrativeAreaCode record component
    • locality

      public String locality()
      Returns the value of the locality record component.
      Returns:
      the value of the locality record component
    • subLocality

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