Record Class Geo
java.lang.Object
java.lang.Record
io.bloviate.datafaker.Geo
- Record Components:
city- the city namestateAbbreviation- the state's two-letter abbreviationstate- the full state namezip- a valid zip/postal code for the cityareaCode- a telephone area code local to the citycountry- 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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionareaCode()Returns the value of theareaCoderecord component.city()Returns the value of thecityrecord component.country()Returns the value of thecountryrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.state()Returns the value of thestaterecord component.Returns the value of thestateAbbreviationrecord component.final StringtoString()Returns a string representation of this record class.zip()Returns the value of theziprecord component.
-
Constructor Details
-
Geo
public Geo(String city, String stateAbbreviation, String state, String zip, String areaCode, String country) Creates an instance of aGeorecord class.- Parameters:
city- the value for thecityrecord componentstateAbbreviation- the value for thestateAbbreviationrecord componentstate- the value for thestaterecord componentzip- the value for theziprecord componentareaCode- the value for theareaCoderecord componentcountry- the value for thecountryrecord component
-
-
Method Details
-
toString
-
hashCode
-
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). -
city
-
stateAbbreviation
Returns the value of thestateAbbreviationrecord component.- Returns:
- the value of the
stateAbbreviationrecord component
-
state
-
zip
-
areaCode
-
country
-