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

org.sackfix.fix44.ResendRequestMessage.scala Maven / Gradle / Ivy

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 ResendRequestMessage(beginSeqNoField:BeginSeqNoField,
                                endSeqNoField:EndSeqNoField) extends SfFixMessageBody("2")  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,beginSeqNoField)
    fmt(b,endSeqNoField)
    b
  }

}
     
object ResendRequestMessage extends SfFixMessageDecoder {
  val MsgType="2"
  val MsgName="ResendRequest"
             
  override val MandatoryFields = HashSet[Int](
    BeginSeqNoField.TagId, EndSeqNoField.TagId)

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

  override val OptionalFields = HashSet[Int]()

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

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

   override lazy val RepeatingGroupsTags = HashSet[Int]()
  
      
  override def isFirstField(tagId:Int) : Boolean = tagId==BeginSeqNoField.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(ResendRequestMessage(BeginSeqNoField.decode(myFields.get(BeginSeqNoField.TagId)).get,
        EndSeqNoField.decode(myFields.get(EndSeqNoField.TagId)).get))
    } else None
  }

    
}
     




© 2015 - 2025 Weber Informatics LLC | Privacy Policy