1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-11-14 08:22:06 +01: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
parent f09ea00fdd
commit 218990c3fe
No known key found for this signature in database
GPG key ID: 4A849A1904CCBD7D

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.