mirror of
https://codeberg.org/PGPainless/sop-java.git
synced 2024-11-26 17:12:08 +01:00
Kotlin conversion: DecryptionResult
This commit is contained in:
parent
a89e70c19e
commit
2391ffc9b2
2 changed files with 16 additions and 29 deletions
|
@ -1,29 +0,0 @@
|
||||||
// SPDX-FileCopyrightText: 2021 Paul Schaub <vanitasvitae@fsfe.org>
|
|
||||||
//
|
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
package sop;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
import sop.util.Optional;
|
|
||||||
|
|
||||||
public class DecryptionResult {
|
|
||||||
|
|
||||||
private final Optional<SessionKey> sessionKey;
|
|
||||||
private final List<Verification> verifications;
|
|
||||||
|
|
||||||
public DecryptionResult(SessionKey sessionKey, List<Verification> verifications) {
|
|
||||||
this.sessionKey = Optional.ofNullable(sessionKey);
|
|
||||||
this.verifications = Collections.unmodifiableList(verifications);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Optional<SessionKey> getSessionKey() {
|
|
||||||
return sessionKey;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<Verification> getVerifications() {
|
|
||||||
return new ArrayList<>(verifications);
|
|
||||||
}
|
|
||||||
}
|
|
16
sop-java/src/main/kotlin/sop/DecryptionResult.kt
Normal file
16
sop-java/src/main/kotlin/sop/DecryptionResult.kt
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
// SPDX-FileCopyrightText: 2023 Paul Schaub <vanitasvitae@fsfe.org>
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
package sop
|
||||||
|
|
||||||
|
import sop.util.Optional
|
||||||
|
|
||||||
|
data class DecryptionResult
|
||||||
|
internal constructor(val sessionKey: Optional<SessionKey>, val verifications: List<Verification>) {
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
sessionKey: SessionKey?,
|
||||||
|
verifications: List<Verification>
|
||||||
|
) : this(Optional.ofNullable(sessionKey), verifications)
|
||||||
|
}
|
Loading…
Reference in a new issue