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 detail
neighborhood - 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

    Constructors
    Constructor
    Description
    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)
    Creates an instance of a AddressRequestDTO record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotBlank(message="Address field \'city\' is required") String
    Returns the value of the city record component.
    Returns the value of the complement record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    @NotBlank(message="Address field \'neighborhood\' is required") String
    Returns the value of the neighborhood record component.
    @NotNull(message="Address field \'number\' is required") Integer
    Returns the value of the number record component.
    @NotBlank(message="Address field \'state\' is required") @Size(min=2,max=2,message="Address field \'state\' must be a 2-letter code") String
    Returns the value of the state record component.
    @NotBlank(message="Address field \'street\' is required") String
    Returns the value of the street record component.
    final String
    Returns a string representation of this record class.
    @NotBlank(message="Address field \'zipcode\' is required") String
    Returns the value of the zipcode record component.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • 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 a AddressRequestDTO record class.
      Parameters:
      zipcode - the value for the zipcode record component
      street - the value for the street record component
      number - the value for the number record component
      complement - the value for the complement record component
      neighborhood - the value for the neighborhood record component
      city - the value for the city record component
      state - the value for the state 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.
    • zipcode

      @NotBlank(message="Address field \'zipcode\' is required") public @NotBlank(message="Address field \'zipcode\' is required") String zipcode()
      Returns the value of the zipcode record component.
      Returns:
      the value of the zipcode record component
    • street

      @NotBlank(message="Address field \'street\' is required") public @NotBlank(message="Address field \'street\' is required") String street()
      Returns the value of the street record component.
      Returns:
      the value of the street record component
    • number

      @NotNull(message="Address field \'number\' is required") public @NotNull(message="Address field \'number\' is required") Integer number()
      Returns the value of the number record component.
      Returns:
      the value of the number record component
    • complement

      public String complement()
      Returns the value of the complement record component.
      Returns:
      the value of the complement record component
    • neighborhood

      @NotBlank(message="Address field \'neighborhood\' is required") public @NotBlank(message="Address field \'neighborhood\' is required") String neighborhood()
      Returns the value of the neighborhood record component.
      Returns:
      the value of the neighborhood record component
    • city

      @NotBlank(message="Address field \'city\' is required") public @NotBlank(message="Address field \'city\' is required") String city()
      Returns the value of the city record component.
      Returns:
      the value of the city record 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 the state record component.
      Returns:
      the value of the state record component