Record Class Address
java.lang.Object
java.lang.Record
energy.eddie.regionconnector.es.datadis.dtos.Address
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thebuildingNumberrecord component.city()Returns the value of thecityrecord component.door()Returns the value of thedoorrecord component.final booleanIndicates whether some other object is "equal to" this one.floor()Returns the value of thefloorrecord component.final inthashCode()Returns a hash code value for this object.Parsing an address string based on: "Street, Number , [FloorºDoor] PostalCode-City - Province" If the address string does not match the expected format, an empty optional is returned.Returns the value of thepostalCoderecord component.province()Returns the value of theprovincerecord component.street()Returns the value of thestreetrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Address
public Address(@Nullable String street, @Nullable String buildingNumber, @Nullable String floor, @Nullable String door, @Nullable String postalCode, @Nullable String city, @Nullable String province) Creates an instance of aAddressrecord class.- Parameters:
street- the value for thestreetrecord componentbuildingNumber- the value for thebuildingNumberrecord componentfloor- the value for thefloorrecord componentdoor- the value for thedoorrecord componentpostalCode- the value for thepostalCoderecord componentcity- the value for thecityrecord componentprovince- the value for theprovincerecord component
-
-
Method Details
-
parse
Parsing an address string based on: "Street, Number , [FloorºDoor] PostalCode-City - Province" If the address string does not match the expected format, an empty optional is returned.- Parameters:
addressString- a spanish address string- Returns:
- an optional address object
-
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). -
street
Returns the value of thestreetrecord component.- Returns:
- the value of the
streetrecord component
-
buildingNumber
Returns the value of thebuildingNumberrecord component.- Returns:
- the value of the
buildingNumberrecord component
-
floor
Returns the value of thefloorrecord component.- Returns:
- the value of the
floorrecord component
-
door
Returns the value of thedoorrecord component.- Returns:
- the value of the
doorrecord component
-
postalCode
Returns the value of thepostalCoderecord component.- Returns:
- the value of the
postalCoderecord component
-
city
Returns the value of thecityrecord component.- Returns:
- the value of the
cityrecord component
-
province
Returns the value of theprovincerecord component.- Returns:
- the value of the
provincerecord component
-