mirror of
https://github.com/pgpainless/pgpainless.git
synced 2025-09-09 18:29:39 +02:00
Simplify code for setExpirationDate()
This commit is contained in:
parent
1acda0e970
commit
edea8121ce
1 changed files with 1 additions and 5 deletions
|
@ -52,12 +52,8 @@ class KeyRingBuilder : KeyRingBuilderInterface<KeyRingBuilder> {
|
|||
addUserId(Strings.fromUTF8ByteArray(userId))
|
||||
|
||||
override fun setExpirationDate(expirationDate: Date?): KeyRingBuilder = apply {
|
||||
if (expirationDate == null) {
|
||||
this.expirationDate = null
|
||||
return@apply
|
||||
}
|
||||
this.expirationDate =
|
||||
expirationDate.let {
|
||||
expirationDate?.let {
|
||||
require(Date() < expirationDate) { "Expiration date must be in the future." }
|
||||
expirationDate
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue