Record Class Geo

java.lang.Object
java.lang.Record
io.bloviate.datafaker.Geo
Record Components:
city - the city name
stateAbbreviation - the state's two-letter abbreviation
state - the full state name
zip - a valid zip/postal code for the city
areaCode - a telephone area code local to the city
country - the country name

public record Geo(String city, String stateAbbreviation, String state, String zip, String areaCode, String country) extends Record
A real, internally consistent geographic tuple for one row: the city, state (and stateAbbreviation), zip, areaCode, and country all belong together (a real city in its real state with a valid local zip and area code) — not "Springfield, WY 90210". Drawn from a bundled reference dataset by Places; this is what Datafaker's independent address parts cannot provide.
Since:
2.12.0
See Also:
  • Constructor Details

    • Geo

      public Geo(String city, String stateAbbreviation, String state, String zip, String areaCode, String country)
      Creates an instance of a Geo record class.
      Parameters:
      city - the value for the city record component
      stateAbbreviation - the value for the stateAbbreviation record component
      state - the value for the state record component
      zip - the value for the zip record component
      areaCode - the value for the areaCode record component
      country - the value for the country 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.
    • city

      public String city()
      Returns the value of the city record component.
      Returns:
      the value of the city record component
    • stateAbbreviation

      public String stateAbbreviation()
      Returns the value of the stateAbbreviation record component.
      Returns:
      the value of the stateAbbreviation record component
    • state

      public String state()
      Returns the value of the state record component.
      Returns:
      the value of the state record component
    • zip

      public String zip()
      Returns the value of the zip record component.
      Returns:
      the value of the zip record component
    • areaCode

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

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