1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-12-25 04:17:59 +01:00

Path, Paths, RegexSet: Implement toString

This commit is contained in:
Heiko Schaefer 2023-06-29 00:14:18 +02:00 committed by Paul Schaub
parent 78aefe154a
commit dd4845d88d
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
3 changed files with 11 additions and 1 deletions

View file

@ -120,4 +120,8 @@ class Path(
residualDepth = certification.trustDepth.min(residualDepth.decrease(1)) residualDepth = certification.trustDepth.min(residualDepth.decrease(1))
edges.add(certification) edges.add(certification)
} }
override fun toString(): String {
return "{${root.fingerprint}} => {${edges.map { it.target }.joinToString(" -> ")}} (residual {$residualDepth})"
}
} }

View file

@ -46,6 +46,8 @@ class Paths(private val _paths: MutableList<Item>) {
* @param amount trust amount * @param amount trust amount
*/ */
data class Item(val path: Path, val amount: Int) { data class Item(val path: Path, val amount: Int) {
override fun toString(): String {
return "$path ($amount)"
}
} }
} }

View file

@ -48,4 +48,8 @@ data class RegexSet(val regexStrings: Set<String>) {
Pattern.compile(it).matcher(string).find() Pattern.compile(it).matcher(string).find()
} }
} }
override fun toString(): String {
return regexStrings.joinToString(", ")
}
} }