1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-06-16 08:34:53 +02:00

Depth: Add fun value() to get the raw value

This commit is contained in:
Heiko Schaefer 2023-07-06 15:12:50 +02:00 committed by Paul Schaub
parent 7032fe4a97
commit 31e7704f89
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311

View file

@ -49,6 +49,15 @@ class Depth private constructor(val limit: Int?) : Comparable<Depth> {
return limit == null
}
/**
* The value of this Depth, as used in OpenPGP.
*
* Unlimited is 255.
*/
fun value(): Int {
return limit ?: 255
}
/**
* Decrease the trust depth by one and return the result.
* If the [Depth] is unconstrained, the result will still be unconstrained.