User

Entity class representing Users.

Author

Jan Müller
data class User(id: String,name: String,transactions: TransactionList,isAdmin: Boolean,password: String?,profileImage: ProfileImage?) : Principal, Entity

Constructors

<init>
Link copied to clipboard
fun <init>(id: String, name: String, transactions: TransactionList, isAdmin: Boolean, password: String?, profileImage: ProfileImage?)

Functions

component1
Link copied to clipboard
operator fun component1(): String
component2
Link copied to clipboard
operator fun component2(): String
component3
Link copied to clipboard
operator fun component3(): TransactionList
component4
Link copied to clipboard
operator fun component4(): Boolean
component5
Link copied to clipboard
operator fun component5(): String?
component6
Link copied to clipboard
operator fun component6(): ProfileImage?
copy
Link copied to clipboard
fun copy(id: String, name: String, transactions: TransactionList, isAdmin: Boolean, password: String?, profileImage: ProfileImage?): User
equals
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
hashCode
Link copied to clipboard
open override fun hashCode(): Int
toString
Link copied to clipboard
open override fun toString(): String

Properties

id
Link copied to clipboard
The id of the User.
open override val id: String
isAdmin
Link copied to clipboard
Indicates whether the User has admin privileges.
val isAdmin: Boolean
name
Link copied to clipboard
The name of the User.
val name: String
password
Link copied to clipboard
The optional password of the User.
val password: String?
profileImage
Link copied to clipboard
val profileImage: ProfileImage?
transactions
Link copied to clipboard
The user's list of Transactions.
val transactions: TransactionList

Extensions

asProfile
Link copied to clipboard
Extension method for turning Users into UserProfiles by extracting metadata and calculating their balances.
fun User.asProfile(): UserProfile
asUserListEntry
Link copied to clipboard
Extension method for turning a User into a UserListEntry by extracting its metadata.
fun User.asUserListEntry(): UserListEntry
withHashedPassword
Link copied to clipboard
Hashes the password of a User if it is not null.
fun User.withHashedPassword(): User