
org.sackfix.fix44.AllocationReportAckMessage.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sackfix-messages-fix44_2.13 Show documentation
Show all versions of sackfix-messages-fix44_2.13 Show documentation
All Fix 4.4 strongly typed messages, purely generated code, do not edit.
The newest version!
package org.sackfix.fix44
import org.sackfix.field._
import org.sackfix.common.validated.fields.{SfFixMessageBody, SfFixMessageDecoder, SfFixFieldsToAscii, SfFixRenderable}
import org.sackfix.common.message.SfRepeatingGroupCountException
import scala.annotation.tailrec
import scala.collection.immutable.HashSet
import scala.collection.mutable.ArrayBuffer
/**
* Generated by SackFix code generator on 20210314
* Source specification was read from:
* /quickfixj1.6.0/FIX44.xml
*/
case class AllocationReportAckMessage(allocReportIDField:AllocReportIDField,
allocIDField:AllocIDField,
partiesComponent:Option[PartiesComponent]=None,
secondaryAllocIDField:Option[SecondaryAllocIDField]=None,
tradeDateField:Option[TradeDateField]=None,
transactTimeField:TransactTimeField,
allocStatusField:AllocStatusField,
allocRejCodeField:Option[AllocRejCodeField]=None,
allocReportTypeField:Option[AllocReportTypeField]=None,
allocIntermedReqTypeField:Option[AllocIntermedReqTypeField]=None,
matchStatusField:Option[MatchStatusField]=None,
productField:Option[ProductField]=None,
securityTypeField:Option[SecurityTypeField]=None,
textField:Option[TextField]=None,
encodedTextLenField:Option[EncodedTextLenField]=None,
encodedTextField:Option[EncodedTextField]=None,
noAllocsField:Option[NoAllocsField]=None,
allocsGroups: Option[List[AllocsGroup]]=None) extends SfFixMessageBody("AT") with SfFixRenderable with SfFixFieldsToAscii {
if (noAllocsField.map(_.value).getOrElse(0) != allocsGroups.map(_.size).getOrElse(0))
throw SfRepeatingGroupCountException(NoAllocsField.TagId,noAllocsField.map(_.value).getOrElse(0), allocsGroups.map(_.size).getOrElse(0))
override lazy val fixStr : String = appendFixStr().toString
override def appendFixStr(b:StringBuilder = new StringBuilder): StringBuilder = format(formatForFix, b)
override def toString():String = appendStringBuilder().toString()
def appendStringBuilder(b:StringBuilder = new StringBuilder) : StringBuilder = format(formatForToString, b)
def format( fmt: ((StringBuilder,SfFixRenderable)=>Unit), b:StringBuilder = new StringBuilder()): StringBuilder = {
fmt(b,allocReportIDField)
fmt(b,allocIDField)
partiesComponent.foreach(fmt(b,_))
secondaryAllocIDField.foreach(fmt(b,_))
tradeDateField.foreach(fmt(b,_))
fmt(b,transactTimeField)
fmt(b,allocStatusField)
allocRejCodeField.foreach(fmt(b,_))
allocReportTypeField.foreach(fmt(b,_))
allocIntermedReqTypeField.foreach(fmt(b,_))
matchStatusField.foreach(fmt(b,_))
productField.foreach(fmt(b,_))
securityTypeField.foreach(fmt(b,_))
textField.foreach(fmt(b,_))
encodedTextLenField.foreach(fmt(b,_))
encodedTextField.foreach(fmt(b,_))
noAllocsField.foreach(fmt(b,_))
allocsGroups.getOrElse(List.empty).foreach(fmt(b,_))
b
}
}
object AllocationReportAckMessage extends SfFixMessageDecoder {
val MsgType="AT"
val MsgName="AllocationReportAck"
override val MandatoryFields = HashSet[Int](
AllocReportIDField.TagId, AllocIDField.TagId, TransactTimeField.TagId, AllocStatusField.TagId)
override def isMandatoryField(tagId:Int) : Boolean = {
MandatoryFields.contains(tagId) ||
PartiesComponent.isMandatoryField(tagId) || AllocsGroup.isMandatoryField(tagId)
}
override val OptionalFields = HashSet[Int](
SecondaryAllocIDField.TagId, TradeDateField.TagId, AllocRejCodeField.TagId, AllocReportTypeField.TagId, AllocIntermedReqTypeField.TagId,
MatchStatusField.TagId, ProductField.TagId, SecurityTypeField.TagId, TextField.TagId, EncodedTextLenField.TagId,
EncodedTextField.TagId, NoAllocsField.TagId)
override def isOptionalField(tagId:Int) : Boolean = {
OptionalFields.contains(tagId) ||
PartiesComponent.isOptionalField(tagId) || AllocsGroup.isOptionalField(tagId)
}
override def isFieldOf(tagId:Int) : Boolean = isMandatoryField(tagId) || isOptionalField(tagId) ||
PartiesComponent.isFieldOf(tagId) || AllocsGroup.isFieldOf(tagId)
override lazy val RepeatingGroupsTags = HashSet[Int](
NoAllocsField.TagId)
override def isFirstField(tagId:Int) : Boolean = tagId==AllocReportIDField.TagId
override def decode(flds: Seq[Tuple2[Int, Any]], startPos:Int = 0):Option[SfFixMessageBody] = {
val (pos, myFields, nextTagPosLookup) = extractMyFieldsAndPopulatePositions(false, flds, startPos)
validateMandatoryFieldsPresent(myFields)
if (MandatoryFields.isEmpty || myFields.nonEmpty) {
Some(AllocationReportAckMessage(AllocReportIDField.decode(myFields.get(AllocReportIDField.TagId)).get,
AllocIDField.decode(myFields.get(AllocIDField.TagId)).get,
PartiesComponent.decode(flds, startPos),
myFields.get(SecondaryAllocIDField.TagId).flatMap(f=>SecondaryAllocIDField.decode(f)),
myFields.get(TradeDateField.TagId).flatMap(f=>TradeDateField.decode(f)),
TransactTimeField.decode(myFields.get(TransactTimeField.TagId)).get,
AllocStatusField.decode(myFields.get(AllocStatusField.TagId)).get,
myFields.get(AllocRejCodeField.TagId).flatMap(f=>AllocRejCodeField.decode(f)),
myFields.get(AllocReportTypeField.TagId).flatMap(f=>AllocReportTypeField.decode(f)),
myFields.get(AllocIntermedReqTypeField.TagId).flatMap(f=>AllocIntermedReqTypeField.decode(f)),
myFields.get(MatchStatusField.TagId).flatMap(f=>MatchStatusField.decode(f)),
myFields.get(ProductField.TagId).flatMap(f=>ProductField.decode(f)),
myFields.get(SecurityTypeField.TagId).flatMap(f=>SecurityTypeField.decode(f)),
myFields.get(TextField.TagId).flatMap(f=>TextField.decode(f)),
myFields.get(EncodedTextLenField.TagId).flatMap(f=>EncodedTextLenField.decode(f)),
myFields.get(EncodedTextField.TagId).flatMap(f=>EncodedTextField.decode(f)),
myFields.get(NoAllocsField.TagId).flatMap(f=>NoAllocsField.decode(f)),
if (nextTagPosLookup.contains(NoAllocsField.TagId)) AllocsGroup.decode(flds, nextTagPosLookup(NoAllocsField.TagId)) else None))
} else None
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy