Skip to content

Commit

Permalink
switch documentation to Kotlin's style
Browse files Browse the repository at this point in the history
  • Loading branch information
scrayos committed Mar 22, 2024
1 parent 48962c8 commit 22197eb
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 10 deletions.
3 changes: 0 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ dependencies {
testImplementation(libs.mockk)
testImplementation(libs.bundles.log4j)
testRuntimeOnly(libs.grpc.netty)

// integrate the dokka html export plugin
dokkaHtmlPlugin(libs.dokka.html)
}

// configure the kotlin extension
Expand Down
1 change: 0 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ kotlin-test = { group = "org.jetbrains.kotlin", name = "kotlin-test" }
slf4j = { group = "org.slf4j", name = "slf4j-api", version.ref = "slf4j" }
log4j-core = { group = "org.apache.logging.log4j", name = "log4j-core", version.ref = "log4j" }
log4j-slf4j = { group = "org.apache.logging.log4j", name = "log4j-slf4j-impl", version.ref = "log4j" }
dokka-html = { group = "org.jetbrains.dokka", name = "kotlin-as-java-plugin", version.ref = "dokka" }
protoc-core = { group = "com.google.protobuf", name = "protoc", version.ref = "protobuf" }
protoc-genJava = { group = "io.grpc", name = "protoc-gen-grpc-java", version.ref = "protoc-java" }
protoc-genKotlin = { group = "io.grpc", name = "protoc-gen-grpc-kotlin", version.ref = "protoc-kotlin" }
Expand Down
6 changes: 2 additions & 4 deletions src/main/kotlin/net/scrayos/xenos/client/GrpcXenosClient.kt
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,11 @@ class GrpcXenosClient(
}
}

override suspend fun getUuids(names: Collection<String>): Map<String, UuidInfo?> = stub.getUuids(
override suspend fun getUuids(names: Collection<String>): Map<String, UuidInfo> = stub.getUuids(
uuidsRequest {
usernames.addAll(names)
},
)
.toResult()
.filter { it.value != null }
).toResult()

override suspend fun getProfile(userId: UUID): ProfileInfo? {
return try {
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/net/scrayos/xenos/client/XenosClient.kt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ interface XenosClient : AutoCloseable {
* retrieve or check the results, all keys have to be submitted in [lowercase][String.lowercase]. That warrants that
* every name will only be present once.
*/
suspend fun getUuids(names: Collection<String>): Map<String, UuidInfo?>
suspend fun getUuids(names: Collection<String>): Map<String, UuidInfo>

/**
* Retrieves the [profile][ProfileInfo] for the supplied [userId] from Xenos. The result includes the moment
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/net/scrayos/xenos/client/data/UuidInfo.kt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ internal fun UuidResponse.toResult(): UuidInfo {
* information that is related to the gRPC origin and is therefore independent of the client implementation, that was
* used to retrieve the data from Xenos.
*/
internal fun UuidsResponse.toResult(): Map<String, UuidInfo?> {
internal fun UuidsResponse.toResult(): Map<String, UuidInfo> {
return resolvedMap
.mapValues {
it.value.toResult()
Expand Down

0 comments on commit 22197eb

Please sign in to comment.