Record Class AddressRequestDTO
java.lang.Object
java.lang.Record
com.fiap.tech_challenge.parte1.ms_users.dtos.AddressRequestDTO
- Record Components:
zipcode- the postal code of the address (required, non-blank)street- the street name of the address (required, non-blank)number- the street number (required, not null)complement- an optional additional address detailneighborhood- the neighborhood name (required, non-blank)city- the city name (required, non-blank)state- the two-letter state code (required, exactly 2 characters)
public record AddressRequestDTO(@NotBlank(message="Address field \'zipcode\' is required") String zipcode, @NotBlank(message="Address field \'street\' is required") String street, @NotNull(message="Address field \'number\' is required") Integer number, String complement, @NotBlank(message="Address field \'neighborhood\' is required") String neighborhood, @NotBlank(message="Address field \'city\' is required") String city, @NotBlank(message="Address field \'state\' is required") @Size(min=2,max=2,message="Address field \'state\' must be a 2-letter code") String state)
extends Record
Data Transfer Object for address requests.
This DTO is used to transfer address data from client to server
when creating or updating a user's address.
Validation constraints ensure required fields are present and valid.
-
Constructor Summary
ConstructorsConstructorDescriptionAddressRequestDTO(@NotBlank(message="Address field \'zipcode\' is required") String zipcode, @NotBlank(message="Address field \'street\' is required") String street, @NotNull(message="Address field \'number\' is required") Integer number, String complement, @NotBlank(message="Address field \'neighborhood\' is required") String neighborhood, @NotBlank(message="Address field \'city\' is required") String city, @NotBlank(message="Address field \'state\' is required") @Size(min=2,max=2,message="Address field \'state\' must be a 2-letter code") String state) Creates an instance of aAddressRequestDTOrecord class. -
Method Summary
Modifier and TypeMethodDescription@NotBlank(message="Address field \'city\' is required") Stringcity()Returns the value of thecityrecord component.Returns the value of thecomplementrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@NotBlank(message="Address field \'neighborhood\' is required") StringReturns the value of theneighborhoodrecord component.@NotNull(message="Address field \'number\' is required") Integernumber()Returns the value of thenumberrecord component.@NotBlank(message="Address field \'state\' is required") @Size(min=2,max=2,message="Address field \'state\' must be a 2-letter code") Stringstate()Returns the value of thestaterecord component.@NotBlank(message="Address field \'street\' is required") Stringstreet()Returns the value of thestreetrecord component.final StringtoString()Returns a string representation of this record class.@NotBlank(message="Address field \'zipcode\' is required") Stringzipcode()Returns the value of thezipcoderecord component.
-
Constructor Details
-
AddressRequestDTO
public AddressRequestDTO(@NotBlank(message="Address field \'zipcode\' is required") @NotBlank(message="Address field \'zipcode\' is required") String zipcode, @NotBlank(message="Address field \'street\' is required") @NotBlank(message="Address field \'street\' is required") String street, @NotNull(message="Address field \'number\' is required") @NotNull(message="Address field \'number\' is required") Integer number, String complement, @NotBlank(message="Address field \'neighborhood\' is required") @NotBlank(message="Address field \'neighborhood\' is required") String neighborhood, @NotBlank(message="Address field \'city\' is required") @NotBlank(message="Address field \'city\' is required") String city, @NotBlank(message="Address field \'state\' is required") @Size(min=2,max=2,message="Address field \'state\' must be a 2-letter code") @NotBlank(message="Address field \'state\' is required") @Size(min=2,max=2,message="Address field \'state\' must be a 2-letter code") String state) Creates an instance of aAddressRequestDTOrecord class.- Parameters:
zipcode- the value for thezipcoderecord componentstreet- the value for thestreetrecord componentnumber- the value for thenumberrecord componentcomplement- the value for thecomplementrecord componentneighborhood- the value for theneighborhoodrecord componentcity- the value for thecityrecord componentstate- the value for thestaterecord 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). -
zipcode
@NotBlank(message="Address field \'zipcode\' is required") public @NotBlank(message="Address field \'zipcode\' is required") String zipcode()Returns the value of thezipcoderecord component.- Returns:
- the value of the
zipcoderecord component
-
street
@NotBlank(message="Address field \'street\' is required") public @NotBlank(message="Address field \'street\' is required") String street()Returns the value of thestreetrecord component.- Returns:
- the value of the
streetrecord component
-
number
@NotNull(message="Address field \'number\' is required") public @NotNull(message="Address field \'number\' is required") Integer number()Returns the value of thenumberrecord component.- Returns:
- the value of the
numberrecord component
-
complement
Returns the value of thecomplementrecord component.- Returns:
- the value of the
complementrecord component
-
neighborhood
@NotBlank(message="Address field \'neighborhood\' is required") public @NotBlank(message="Address field \'neighborhood\' is required") String neighborhood()Returns the value of theneighborhoodrecord component.- Returns:
- the value of the
neighborhoodrecord component
-
city
@NotBlank(message="Address field \'city\' is required") public @NotBlank(message="Address field \'city\' is required") String city()Returns the value of thecityrecord component.- Returns:
- the value of the
cityrecord component
-
state
@NotBlank(message="Address field \'state\' is required") @Size(min=2, max=2, message="Address field \'state\' must be a 2-letter code") public @NotBlank(message="Address field \'state\' is required") @Size(min=2,max=2,message="Address field \'state\' must be a 2-letter code") String state()Returns the value of thestaterecord component.- Returns:
- the value of the
staterecord component
-