Record Class AddressDTO
java.lang.Object
java.lang.Record
com.mirna.hospitalmanagementapi.domain.dtos.AddressDTO
public record AddressDTO(@NotBlank(message="street cannot be blank") String street, @NotBlank(message="neighborhood cannot be blank") String neighborhood, @NotBlank(message="zipCode cannot be blank") @Pattern(regexp="\\d{8}",message="invalid format for zipCode") String zipCode, @NotBlank(message="city cannot be blank") String city, @NotBlank(message="state cannot be blank") String state, String additionalDetails, String houseNumber)
extends Record
Data transfer object used to transfer data that will be saved in a Address entity
- Version:
- 1.0
- Author:
- Mirna Gama
-
Constructor Summary
ConstructorsConstructorDescriptionAddressDTO(@NotBlank(message="street cannot be blank") String street, @NotBlank(message="neighborhood cannot be blank") String neighborhood, @NotBlank(message="zipCode cannot be blank") @Pattern(regexp="\\d{8}",message="invalid format for zipCode") String zipCode, @NotBlank(message="city cannot be blank") String city, @NotBlank(message="state cannot be blank") String state, String additionalDetails, String houseNumber) Creates an instance of aAddressDTOrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theadditionalDetailsrecord component.@NotBlank(message="city cannot be blank") Stringcity()Returns the value of thecityrecord 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 thehouseNumberrecord component.@NotBlank(message="neighborhood cannot be blank") StringReturns the value of theneighborhoodrecord component.@NotBlank(message="state cannot be blank") Stringstate()Returns the value of thestaterecord component.@NotBlank(message="street cannot be blank") Stringstreet()Returns the value of thestreetrecord component.final StringtoString()Returns a string representation of this record class.@NotBlank(message="zipCode cannot be blank") @Pattern(regexp="\\d{8}",message="invalid format for zipCode") StringzipCode()Returns the value of thezipCoderecord component.
-
Constructor Details
-
AddressDTO
public AddressDTO(@NotBlank(message="street cannot be blank") @NotBlank(message="street cannot be blank") String street, @NotBlank(message="neighborhood cannot be blank") @NotBlank(message="neighborhood cannot be blank") String neighborhood, @NotBlank(message="zipCode cannot be blank") @Pattern(regexp="\\d{8}",message="invalid format for zipCode") @NotBlank(message="zipCode cannot be blank") @Pattern(regexp="\\d{8}",message="invalid format for zipCode") String zipCode, @NotBlank(message="city cannot be blank") @NotBlank(message="city cannot be blank") String city, @NotBlank(message="state cannot be blank") @NotBlank(message="state cannot be blank") String state, String additionalDetails, String houseNumber) Creates an instance of aAddressDTOrecord class.- Parameters:
street- the value for thestreetrecord componentneighborhood- the value for theneighborhoodrecord componentzipCode- the value for thezipCoderecord componentcity- the value for thecityrecord componentstate- the value for thestaterecord componentadditionalDetails- the value for theadditionalDetailsrecord componenthouseNumber- the value for thehouseNumberrecord 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). -
street
@NotBlank(message="street cannot be blank") public @NotBlank(message="street cannot be blank") String street()Returns the value of thestreetrecord component.- Returns:
- the value of the
streetrecord component
-
neighborhood
@NotBlank(message="neighborhood cannot be blank") public @NotBlank(message="neighborhood cannot be blank") String neighborhood()Returns the value of theneighborhoodrecord component.- Returns:
- the value of the
neighborhoodrecord component
-
zipCode
@NotBlank(message="zipCode cannot be blank") @Pattern(regexp="\\d{8}", message="invalid format for zipCode") public @NotBlank(message="zipCode cannot be blank") @Pattern(regexp="\\d{8}",message="invalid format for zipCode") String zipCode()Returns the value of thezipCoderecord component.- Returns:
- the value of the
zipCoderecord component
-
city
@NotBlank(message="city cannot be blank") public @NotBlank(message="city cannot be blank") String city()Returns the value of thecityrecord component.- Returns:
- the value of the
cityrecord component
-
state
@NotBlank(message="state cannot be blank") public @NotBlank(message="state cannot be blank") String state()Returns the value of thestaterecord component.- Returns:
- the value of the
staterecord component
-
additionalDetails
Returns the value of theadditionalDetailsrecord component.- Returns:
- the value of the
additionalDetailsrecord component
-
houseNumber
Returns the value of thehouseNumberrecord component.- Returns:
- the value of the
houseNumberrecord component
-