From: David ‘Bombe’ Roden Date: Tue, 6 Dec 2022 21:36:04 +0000 (+0100) Subject: 🎨 Add methods to create explicit and implicit trust values X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=a5c00f1b023ee87a8d3c2f2ece6b955c87e62afb;p=Sone.git 🎨 Add methods to create explicit and implicit trust values --- diff --git a/src/main/kotlin/net/pterodactylus/sone/freenet/wot/Trust.kt b/src/main/kotlin/net/pterodactylus/sone/freenet/wot/Trust.kt index 779dd20..f54cfc3 100644 --- a/src/main/kotlin/net/pterodactylus/sone/freenet/wot/Trust.kt +++ b/src/main/kotlin/net/pterodactylus/sone/freenet/wot/Trust.kt @@ -21,3 +21,6 @@ package net.pterodactylus.sone.freenet.wot * Container class for trust in the web of trust. */ data class Trust(val explicit: Int?, val implicit: Int?, val distance: Int?) + +fun trustExplicitely(value: Int) = Trust(explicit = value, implicit = null, distance = 1) +fun trustImplicitely(value: Int, distance: Int = 2) = Trust(explicit = null, implicit = value, distance)