Record Class AdminUpdateUserRequest

java.lang.Object
java.lang.Record
api.mpba.rastvdmy.dto.request.AdminUpdateUserRequest
Record Components:
surname - The surname of the user.
countryOfOrigin - The country of origin of the user.

public record AdminUpdateUserRequest(String surname, String countryOfOrigin) extends Record
A Data Transfer Object (DTO) that represents a request to update a user's details by an administrator. This record is used to encapsulate the fields needed for the update operation, ensuring type safety and immutability.

The following fields are included:

  • surname: The surname of the user to be updated.
  • countryOfOrigin: The country of origin of the user, represented as a string. This field is serialized to/from JSON with the key "country_of_origin".
  • Constructor Details

    • AdminUpdateUserRequest

      public AdminUpdateUserRequest(String surname, String countryOfOrigin)
      Creates an instance of a AdminUpdateUserRequest record class.
      Parameters:
      surname - the value for the surname record component
      countryOfOrigin - the value for the countryOfOrigin 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.
    • surname

      public String surname()
      Returns the value of the surname record component.
      Returns:
      the value of the surname record component
    • countryOfOrigin

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