From 31e7704f890e724f97ae104894852b8c5b4b6089 Mon Sep 17 00:00:00 2001 From: Heiko Schaefer Date: Thu, 6 Jul 2023 15:12:50 +0200 Subject: [PATCH] Depth: Add fun value() to get the raw value --- .../main/kotlin/org/pgpainless/wot/dijkstra/sq/Depth.kt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/dijkstra/sq/Depth.kt b/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/dijkstra/sq/Depth.kt index 1b747f20..9c0bbe0d 100644 --- a/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/dijkstra/sq/Depth.kt +++ b/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/dijkstra/sq/Depth.kt @@ -49,6 +49,15 @@ class Depth private constructor(val limit: Int?) : Comparable { 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.