Package edu.ucsb.cs156.dining.models
Record Class UserDTO
java.lang.Object
java.lang.Record
edu.ucsb.cs156.dining.models.UserDTO
public record UserDTO(long id, String email, String googleSub, String pictureUrl, String fullName, String givenName, String familyName, boolean emailVerified, String locale, String hostedDomain, boolean admin, boolean moderator, String alias, String proposedAlias, ModerationStatus status, LocalDate dateApproved)
extends Record
Response model for user data with computed role flags.
-
Constructor Summary
ConstructorsConstructorDescriptionUserDTO(long id, String email, String googleSub, String pictureUrl, String fullName, String givenName, String familyName, boolean emailVerified, String locale, String hostedDomain, boolean admin, boolean moderator, String alias, String proposedAlias, ModerationStatus status, LocalDate dateApproved) Creates an instance of aUserDTOrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanadmin()Returns the value of theadminrecord component.alias()Returns the value of thealiasrecord component.Returns the value of thedateApprovedrecord component.email()Returns the value of theemailrecord component.booleanReturns the value of theemailVerifiedrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of thefamilyNamerecord component.fullName()Returns the value of thefullNamerecord component.Returns the value of thegivenNamerecord component.Returns the value of thegoogleSubrecord component.final inthashCode()Returns a hash code value for this object.Returns the value of thehostedDomainrecord component.longid()Returns the value of theidrecord component.locale()Returns the value of thelocalerecord component.booleanReturns the value of themoderatorrecord component.Returns the value of thepictureUrlrecord component.Returns the value of theproposedAliasrecord component.status()Returns the value of thestatusrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
UserDTO
-
UserDTO
public UserDTO(long id, String email, String googleSub, String pictureUrl, String fullName, String givenName, String familyName, boolean emailVerified, String locale, String hostedDomain, boolean admin, boolean moderator, String alias, String proposedAlias, ModerationStatus status, LocalDate dateApproved) Creates an instance of aUserDTOrecord class.- Parameters:
id- the value for theidrecord componentemail- the value for theemailrecord componentgoogleSub- the value for thegoogleSubrecord componentpictureUrl- the value for thepictureUrlrecord componentfullName- the value for thefullNamerecord componentgivenName- the value for thegivenNamerecord componentfamilyName- the value for thefamilyNamerecord componentemailVerified- the value for theemailVerifiedrecord componentlocale- the value for thelocalerecord componenthostedDomain- the value for thehostedDomainrecord componentadmin- the value for theadminrecord componentmoderator- the value for themoderatorrecord componentalias- the value for thealiasrecord componentproposedAlias- the value for theproposedAliasrecord componentstatus- the value for thestatusrecord componentdateApproved- the value for thedateApprovedrecord component
-
-
Method Details
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
id
public long id()Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
email
Returns the value of theemailrecord component.- Returns:
- the value of the
emailrecord component
-
googleSub
Returns the value of thegoogleSubrecord component.- Returns:
- the value of the
googleSubrecord component
-
pictureUrl
Returns the value of thepictureUrlrecord component.- Returns:
- the value of the
pictureUrlrecord component
-
fullName
Returns the value of thefullNamerecord component.- Returns:
- the value of the
fullNamerecord component
-
givenName
Returns the value of thegivenNamerecord component.- Returns:
- the value of the
givenNamerecord component
-
familyName
Returns the value of thefamilyNamerecord component.- Returns:
- the value of the
familyNamerecord component
-
emailVerified
public boolean emailVerified()Returns the value of theemailVerifiedrecord component.- Returns:
- the value of the
emailVerifiedrecord component
-
locale
Returns the value of thelocalerecord component.- Returns:
- the value of the
localerecord component
-
hostedDomain
Returns the value of thehostedDomainrecord component.- Returns:
- the value of the
hostedDomainrecord component
-
admin
public boolean admin()Returns the value of theadminrecord component.- Returns:
- the value of the
adminrecord component
-
moderator
public boolean moderator()Returns the value of themoderatorrecord component.- Returns:
- the value of the
moderatorrecord component
-
alias
Returns the value of thealiasrecord component.- Returns:
- the value of the
aliasrecord component
-
proposedAlias
Returns the value of theproposedAliasrecord component.- Returns:
- the value of the
proposedAliasrecord component
-
status
Returns the value of thestatusrecord component.- Returns:
- the value of the
statusrecord component
-
dateApproved
Returns the value of thedateApprovedrecord component.- Returns:
- the value of the
dateApprovedrecord component
-