1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-11-16 01:12:05 +01:00

Path, Paths, RegexSet: Implement toString

This commit is contained in:
Heiko Schaefer 2023-06-29 00:14:18 +02:00
parent ac5919bcf7
commit 461a2bebd4
No known key found for this signature in database
GPG key ID: 4A849A1904CCBD7D
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(", ")
}
} }