Added debugging output to Segment (and Segmentkopf)

This commit is contained in:
dankito 2024-08-21 04:05:00 +02:00
parent ba6eab79bb
commit 7971fc116c
2 changed files with 8 additions and 3 deletions

View File

@ -9,9 +9,9 @@ import net.dankito.banking.fints.messages.segmente.id.ISegmentId
open class Segmentkopf(
identifier: String,
segmentVersion: Int,
segmentNumber: Int = 0,
val identifier: String,
val segmentVersion: Int,
val segmentNumber: Int = 0,
bezugssegment: Int? = null
) : Datenelementgruppe(listOf(
@ -22,4 +22,6 @@ open class Segmentkopf(
constructor(id: ISegmentId, segmentVersion: Int, segmentNumber: Int) : this(id.id, segmentVersion, segmentNumber)
override fun toString() = "$identifier:$segmentNumber:$segmentVersion"
}

View File

@ -4,6 +4,7 @@ import net.dankito.banking.fints.messages.Nachrichtenteil
import net.dankito.banking.fints.messages.Separators
import net.dankito.banking.fints.messages.datenelemente.DatenelementBase
import net.dankito.banking.fints.messages.datenelemente.implementierte.DoNotPrintDatenelement
import net.dankito.banking.fints.messages.datenelementgruppen.implementierte.Segmentkopf
abstract class Segment(val dataElementsAndGroups: List<DatenelementBase>) : Nachrichtenteil() {
@ -28,4 +29,6 @@ abstract class Segment(val dataElementsAndGroups: List<DatenelementBase>) : Nach
return ReplaceEmptyDataElementGroupSeparatorsAtEndPattern.replaceFirst(formattedSegment, "")
}
override fun toString() = "${dataElementsAndGroups.firstOrNull { it is Segmentkopf }}"
}