src/main/kotlin/de/uapcore/lightpit/entities/User.kt

changeset 232
296e12ff8d1c
parent 180
009700915269
child 257
c1be672af7ff
--- a/src/main/kotlin/de/uapcore/lightpit/entities/User.kt	Thu Aug 19 14:51:04 2021 +0200
+++ b/src/main/kotlin/de/uapcore/lightpit/entities/User.kt	Thu Aug 19 17:20:43 2021 +0200
@@ -31,11 +31,18 @@
     var givenname: String? = null
     var lastname: String? = null
 
+    /**
+     * The display name without mail address.
+     */
     val shortDisplayname: String
         get() {
             val str = "${givenname ?: ""} ${lastname ?: ""}"
             return if (str.isBlank()) username else str.trim()
         }
 
+    /**
+     * Shows the full name plus mail address.
+     * If neither given name nor lastname are provided, the username is used instead.
+     */
     val displayname: String get() = if (mail.isNullOrBlank()) shortDisplayname else "$shortDisplayname <$mail>"
 }
\ No newline at end of file

mercurial