From c33e96b82c2b65b8ef4271ef7cccc27dbc59a4c2 Mon Sep 17 00:00:00 2001 From: ganfra Date: Fri, 25 Jan 2019 15:44:41 +0100 Subject: [PATCH] Add comments in API packages --- .../features/home/room/detail/timeline/ddd.kt | 18 ------------------ .../api/session/group/model/GroupSummary.kt | 4 ++++ .../android/api/session/room/model/Invite.kt | 4 +++- .../api/session/room/model/Membership.kt | 3 +++ .../api/session/room/model/MyMembership.kt | 3 +++ .../api/session/room/model/PowerLevels.kt | 3 +++ .../session/room/model/RoomAliasesContent.kt | 3 +++ .../session/room/model/RoomAvatarContent.kt | 3 +++ .../room/model/RoomCanonicalAliasContent.kt | 3 +++ .../api/session/room/model/RoomMember.kt | 3 +++ .../api/session/room/model/RoomNameContent.kt | 3 +++ .../api/session/room/model/RoomSummary.kt | 4 ++++ .../api/session/room/model/RoomTopicContent.kt | 3 +++ .../android/api/session/room/model/Signed.kt | 2 +- 14 files changed, 39 insertions(+), 20 deletions(-) delete mode 100644 app/src/main/java/im/vector/riotredesign/features/home/room/detail/timeline/ddd.kt diff --git a/app/src/main/java/im/vector/riotredesign/features/home/room/detail/timeline/ddd.kt b/app/src/main/java/im/vector/riotredesign/features/home/room/detail/timeline/ddd.kt deleted file mode 100644 index 450cadba25..0000000000 --- a/app/src/main/java/im/vector/riotredesign/features/home/room/detail/timeline/ddd.kt +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright 2019 New Vector Ltd - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package im.vector.riotredesign.features.home.room.detail.timeline - diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/group/model/GroupSummary.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/group/model/GroupSummary.kt index c27b6e8f10..3089d83dde 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/group/model/GroupSummary.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/group/model/GroupSummary.kt @@ -16,6 +16,10 @@ package im.vector.matrix.android.api.session.group.model +/** + * This class holds some data of a group. + * It can be retrieved through [im.vector.matrix.android.api.session.group.GroupService] + */ data class GroupSummary( val groupId: String, val displayName: String = "", diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/Invite.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/Invite.kt index 8568b0d2de..c808ad556c 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/Invite.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/Invite.kt @@ -18,8 +18,10 @@ package im.vector.matrix.android.api.session.room.model import com.squareup.moshi.Json import com.squareup.moshi.JsonClass -import im.vector.matrix.android.api.session.room.Signed +/** + * Subclass representing a search API response + */ @JsonClass(generateAdapter = true) data class Invite( @Json(name = "display_name") val displayName: String, diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/Membership.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/Membership.kt index fc21e0fdb0..09d7a7decd 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/Membership.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/Membership.kt @@ -18,6 +18,9 @@ package im.vector.matrix.android.api.session.room.model import com.squareup.moshi.Json +/** + * Represents the membership of a user on a room. Linked to a [RoomMember] + */ enum class Membership(val value: String) { @Json(name = "invite") diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/MyMembership.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/MyMembership.kt index 152d13b389..cd9c393208 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/MyMembership.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/MyMembership.kt @@ -16,6 +16,9 @@ package im.vector.matrix.android.api.session.room.model +/** + * Represents the membership of the current auth user on a room. + */ enum class MyMembership { JOINED, LEFT, diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/PowerLevels.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/PowerLevels.kt index 25b094f3a4..964d618264 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/PowerLevels.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/PowerLevels.kt @@ -22,6 +22,9 @@ import com.squareup.moshi.JsonClass import im.vector.matrix.android.api.session.events.model.EventType import java.util.* +/** + * Class representing the EventType.EVENT_TYPE_STATE_ROOM_POWER_LEVELS state event content. + */ @JsonClass(generateAdapter = true) data class PowerLevels( @Json(name = "ban") val ban: Int = 50, diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/RoomAliasesContent.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/RoomAliasesContent.kt index 39c9a64095..74b29b7aea 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/RoomAliasesContent.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/RoomAliasesContent.kt @@ -19,6 +19,9 @@ package im.vector.matrix.android.api.session.room.model import com.squareup.moshi.Json import com.squareup.moshi.JsonClass +/** + * Class representing the EventType.STATE_ROOM_ALIASES state event content + */ @JsonClass(generateAdapter = true) data class RoomAliasesContent( @Json(name = "aliases") val aliases: List = emptyList() diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/RoomAvatarContent.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/RoomAvatarContent.kt index c4f978720b..8f81632bf4 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/RoomAvatarContent.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/RoomAvatarContent.kt @@ -19,6 +19,9 @@ package im.vector.matrix.android.api.session.room.model import com.squareup.moshi.Json import com.squareup.moshi.JsonClass +/** + * Class representing the EventType.STATE_ROOM_AVATAR state event content + */ @JsonClass(generateAdapter = true) data class RoomAvatarContent( @Json(name = "url") val avatarUrl: String? = null diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/RoomCanonicalAliasContent.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/RoomCanonicalAliasContent.kt index 3e65ac18d4..abaa9f0a6c 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/RoomCanonicalAliasContent.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/RoomCanonicalAliasContent.kt @@ -19,6 +19,9 @@ package im.vector.matrix.android.api.session.room.model import com.squareup.moshi.Json import com.squareup.moshi.JsonClass +/** + * Class representing the EventType.STATE_CANONICAL_ALIAS state event content + */ @JsonClass(generateAdapter = true) data class RoomCanonicalAliasContent( @Json(name = "alias") val canonicalAlias: String? = null diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/RoomMember.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/RoomMember.kt index 6de0be1dd6..10c3e8ec7c 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/RoomMember.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/RoomMember.kt @@ -20,6 +20,9 @@ import com.squareup.moshi.Json import com.squareup.moshi.JsonClass import im.vector.matrix.android.api.session.events.model.UnsignedData +/** + * Class representing the EventType.STATE_ROOM_MEMBER state event content + */ @JsonClass(generateAdapter = true) data class RoomMember( @Json(name = "membership") val membership: Membership, diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/RoomNameContent.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/RoomNameContent.kt index 39f204eafe..48cbb91cac 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/RoomNameContent.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/RoomNameContent.kt @@ -19,6 +19,9 @@ package im.vector.matrix.android.api.session.room.model import com.squareup.moshi.Json import com.squareup.moshi.JsonClass +/** + * Class representing the EventType.STATE_ROOM_NAME state event content + */ @JsonClass(generateAdapter = true) data class RoomNameContent( @Json(name = "name") val name: String? = null diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/RoomSummary.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/RoomSummary.kt index 2a99f0dcb9..0759086bd4 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/RoomSummary.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/RoomSummary.kt @@ -16,6 +16,10 @@ package im.vector.matrix.android.api.session.room.model +/** + * This class holds some data of a room. + * It can be retrieved by [im.vector.matrix.android.api.session.room.Room] and [im.vector.matrix.android.api.session.room.RoomService] + */ data class RoomSummary( val roomId: String, val displayName: String = "", diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/RoomTopicContent.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/RoomTopicContent.kt index 544cb9dc21..8a6e3f90f3 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/RoomTopicContent.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/RoomTopicContent.kt @@ -19,6 +19,9 @@ package im.vector.matrix.android.api.session.room.model import com.squareup.moshi.Json import com.squareup.moshi.JsonClass +/** + * Class representing the EventType.STATE_ROOM_TOPIC state event content + */ @JsonClass(generateAdapter = true) data class RoomTopicContent( @Json(name = "topic") val topic: String? = null diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/Signed.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/Signed.kt index cfcbc2bc5b..4f0e5212fb 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/Signed.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/Signed.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package im.vector.matrix.android.api.session.room +package im.vector.matrix.android.api.session.room.model import com.squareup.moshi.Json