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

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

    Modifier and Type
    Method
    Description
    Returns the value of the additionalDetails record component.
    @NotBlank(message="city cannot be blank") String
    Returns the value of the city record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    Returns the value of the houseNumber record component.
    @NotBlank(message="neighborhood cannot be blank") String
    Returns the value of the neighborhood record component.
    @NotBlank(message="state cannot be blank") String
    Returns the value of the state record component.
    @NotBlank(message="street cannot be blank") String
    Returns the value of the street record component.
    final String
    Returns a string representation of this record class.
    @NotBlank(message="zipCode cannot be blank") @Pattern(regexp="\\d{8}",message="invalid format for zipCode") String
    Returns the value of the zipCode record component.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • 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 a AddressDTO record class.
      Parameters:
      street - the value for the street record component
      neighborhood - the value for the neighborhood record component
      zipCode - the value for the zipCode record component
      city - the value for the city record component
      state - the value for the state record component
      additionalDetails - the value for the additionalDetails record component
      houseNumber - the value for the houseNumber 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.
    • street

      @NotBlank(message="street cannot be blank") public @NotBlank(message="street cannot be blank") String street()
      Returns the value of the street record component.
      Returns:
      the value of the street record component
    • neighborhood

      @NotBlank(message="neighborhood cannot be blank") public @NotBlank(message="neighborhood cannot be blank") String neighborhood()
      Returns the value of the neighborhood record component.
      Returns:
      the value of the neighborhood record 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 the zipCode record component.
      Returns:
      the value of the zipCode record component
    • city

      @NotBlank(message="city cannot be blank") public @NotBlank(message="city cannot be blank") String city()
      Returns the value of the city record component.
      Returns:
      the value of the city record component
    • state

      @NotBlank(message="state cannot be blank") public @NotBlank(message="state cannot be blank") String state()
      Returns the value of the state record component.
      Returns:
      the value of the state record component
    • additionalDetails

      public String additionalDetails()
      Returns the value of the additionalDetails record component.
      Returns:
      the value of the additionalDetails record component
    • houseNumber

      public String houseNumber()
      Returns the value of the houseNumber record component.
      Returns:
      the value of the houseNumber record component