All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sackfix.fix50sp2modified.StreamAssignmentReportMessage.scala Maven / Gradle / Ivy

The newest version!
package org.sackfix.fix50sp2modified

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 20170404
  * Source specification was read from:
  *   /quickfixj1.6.0/FIX50SP2.modified.xml
  */
case class StreamAssignmentReportMessage(streamAsgnRptIDField:StreamAsgnRptIDField,
                                         streamAsgnReqTypeField:Option[StreamAsgnReqTypeField]=None,
                                         streamAsgnReqIDField:Option[StreamAsgnReqIDField]=None,
                                         strmAsgnRptGrpComponent:Option[StrmAsgnRptGrpComponent]=None) extends SfFixMessageBody("CD")  with SfFixRenderable with SfFixFieldsToAscii {

  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,streamAsgnRptIDField)
    streamAsgnReqTypeField.foreach(fmt(b,_))
    streamAsgnReqIDField.foreach(fmt(b,_))
    strmAsgnRptGrpComponent.foreach(fmt(b,_))
    b
  }

}
     
object StreamAssignmentReportMessage extends SfFixMessageDecoder {
  val MsgType="CD"
  val MsgName="StreamAssignmentReport"
             
  override val MandatoryFields = HashSet[Int](
    StreamAsgnRptIDField.TagId)

  override def isMandatoryField(tagId:Int) : Boolean = {
    MandatoryFields.contains(tagId)  || 
    StrmAsgnRptGrpComponent.isMandatoryField(tagId)
  }

  override val OptionalFields = HashSet[Int](
    StreamAsgnReqTypeField.TagId, StreamAsgnReqIDField.TagId)

  override def isOptionalField(tagId:Int) : Boolean = {
    OptionalFields.contains(tagId)  || 
    StrmAsgnRptGrpComponent.isOptionalField(tagId)
  }

  override def isFieldOf(tagId:Int) : Boolean = isMandatoryField(tagId) || isOptionalField(tagId)  || 
    StrmAsgnRptGrpComponent.isFieldOf(tagId)

   override lazy val RepeatingGroupsTags = HashSet[Int]()
  
      
  override def isFirstField(tagId:Int) : Boolean = tagId==StreamAsgnRptIDField.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(StreamAssignmentReportMessage(StreamAsgnRptIDField.decode(myFields.get(StreamAsgnRptIDField.TagId)).get,
        myFields.get(StreamAsgnReqTypeField.TagId).flatMap(f=>StreamAsgnReqTypeField.decode(f)),
        myFields.get(StreamAsgnReqIDField.TagId).flatMap(f=>StreamAsgnReqIDField.decode(f)),
        StrmAsgnRptGrpComponent.decode(flds, startPos)))
    } else None
  }

    
}
     




© 2015 - 2025 Weber Informatics LLC | Privacy Policy