Package com.dani.bff.dto
Record Class DownstreamUserResponse
java.lang.Object
java.lang.Record
com.dani.bff.dto.DownstreamUserResponse
- Record Components:
id- downstream user identifierfirstName- user's first name when the service exposes separate name fieldslastName- user's last name when the service exposes separate name fieldsdisplayName- display-ready name when supplied directly by the serviceemail- email address used by the React dashboard
public record DownstreamUserResponse(String id, String firstName, String lastName, String displayName, String email)
extends Record
User representation returned by the downstream user service.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedisplayNamerecord component.email()Returns the value of theemailrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of thefirstNamerecord component.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.lastName()Returns the value of thelastNamerecord component.final StringtoString()Returns a string representation of this record class.toUserProfile(String requestedUserId) Converts the downstream contract into the stable BFF user contract.
-
Constructor Details
-
DownstreamUserResponse
public DownstreamUserResponse(String id, String firstName, String lastName, String displayName, String email) Creates an instance of aDownstreamUserResponserecord class.- Parameters:
id- the value for theidrecord componentfirstName- the value for thefirstNamerecord componentlastName- the value for thelastNamerecord componentdisplayName- the value for thedisplayNamerecord componentemail- the value for theemailrecord component
-
-
Method Details
-
toUserProfile
Converts the downstream contract into the stable BFF user contract.- Parameters:
requestedUserId- user identifier requested by the BFF- Returns:
- user profile used by the dashboard response
-
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). -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
firstName
Returns the value of thefirstNamerecord component.- Returns:
- the value of the
firstNamerecord component
-
lastName
Returns the value of thelastNamerecord component.- Returns:
- the value of the
lastNamerecord component
-
displayName
Returns the value of thedisplayNamerecord component.- Returns:
- the value of the
displayNamerecord component
-
email
Returns the value of theemailrecord component.- Returns:
- the value of the
emailrecord component
-