Record Class CurrentUserDTO
java.lang.Object
java.lang.Record
edu.ucsb.cs156.dining.models.CurrentUserDTO
public record CurrentUserDTO(UserDTO user, Collection<? extends org.springframework.security.core.GrantedAuthority> roles)
extends Record
Response model for the current user endpoint.
-
Constructor Summary
ConstructorsConstructorDescriptionCurrentUserDTO(UserDTO user, Collection<? extends org.springframework.security.core.GrantedAuthority> roles) Creates an instance of aCurrentUserDTOrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Collection<? extends org.springframework.security.core.GrantedAuthority> roles()Returns the value of therolesrecord component.final StringtoString()Returns a string representation of this record class.user()Returns the value of theuserrecord component.
-
Constructor Details
-
CurrentUserDTO
public CurrentUserDTO(UserDTO user, Collection<? extends org.springframework.security.core.GrantedAuthority> roles) Creates an instance of aCurrentUserDTOrecord class.- Parameters:
user- the value for theuserrecord componentroles- the value for therolesrecord component
-
-
Method Details
-
toString
-
hashCode
-
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). -
user
Returns the value of theuserrecord component.- Returns:
- the value of the
userrecord component
-
roles
Returns the value of therolesrecord component.- Returns:
- the value of the
rolesrecord component
-