Skip to content

Commit

Permalink
📖 DOC: comments on data classes
Browse files Browse the repository at this point in the history
Signed-off-by: Jonas Sulzer <[email protected]>
  • Loading branch information
violoncelloCH committed Jun 2, 2024
1 parent c597184 commit 208b9b5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ package com.github.swent.echo.data.model
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

/**
* A simplified version of the Association data class, used to embed into other data classes
* avoiding to embed the complete heavy Association data class.
*
* @property associationId the unique id of the association
* @property name the name of the association
*/
@Serializable
data class AssociationHeader(
@SerialName("association_id") val associationId: String,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
package com.github.swent.echo.data.model

/**
* Supertype for other data classes having a unique id. Provides a unified way to get the unique id
* of the object.
*/
sealed class DataModel {
fun getId(): String =
when (this) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

/**
* A creator of an event.
* A creator of an event. A simplified version of the Event data class, used to embed into other
* data classes avoiding to embed the complete heavy Event data class.
*
* @property userId The ID of the user who created the event.
* @property name The name of the creator. This same name as in the [UserProfile] corresponding to
Expand Down

0 comments on commit 208b9b5

Please sign in to comment.