org.sackfix.fix50sp2modified.TimeInForceRulesComponent.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sackfix-messages-fix50sp2modified_2.11 Show documentation
Show all versions of sackfix-messages-fix50sp2modified_2.11 Show documentation
All Fix 5.0sp2modified strongly typed messages, purely generated code, do not edit.
The newest version!
package org.sackfix.fix50sp2modified
import org.sackfix.field._
import org.sackfix.common.validated.fields.{SfFixComponent, SfFixDecoder, 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 TimeInForceRulesComponent(noTimeInForceRulesField:Option[NoTimeInForceRulesField]=None,
timeInForceRulesGroups: Option[List[TimeInForceRulesGroup]]=None) extends SfFixComponent with SfFixRenderable with SfFixFieldsToAscii {
if (noTimeInForceRulesField.map(_.value).getOrElse(0) != timeInForceRulesGroups.map(_.size).getOrElse(0))
throw SfRepeatingGroupCountException(NoTimeInForceRulesField.TagId,noTimeInForceRulesField.map(_.value).getOrElse(0), timeInForceRulesGroups.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 = {
noTimeInForceRulesField.foreach(fmt(b,_))
timeInForceRulesGroups.getOrElse(List.empty).foreach(fmt(b,_))
b
}
}
object TimeInForceRulesComponent extends SfFixDecoder {
override val MandatoryFields = HashSet[Int]()
override def isMandatoryField(tagId:Int) : Boolean = {
MandatoryFields.contains(tagId) ||
TimeInForceRulesGroup.isMandatoryField(tagId)
}
override val OptionalFields = HashSet[Int](
NoTimeInForceRulesField.TagId)
override def isOptionalField(tagId:Int) : Boolean = {
OptionalFields.contains(tagId) ||
TimeInForceRulesGroup.isOptionalField(tagId)
}
override def isFieldOf(tagId:Int) : Boolean = isMandatoryField(tagId) || isOptionalField(tagId) ||
TimeInForceRulesGroup.isFieldOf(tagId)
override lazy val RepeatingGroupsTags = HashSet[Int](
NoTimeInForceRulesField.TagId)
override def isFirstField(tagId:Int) : Boolean = TimeInForceRulesGroup.isFirstField(tagId)
def decode(flds: Seq[Tuple2[Int, Any]], startPos:Int = 0):Option[TimeInForceRulesComponent] = {
val (pos, myFields, nextTagPosLookup) = extractMyFieldsAndPopulatePositions(false, flds, startPos)
validateMandatoryFieldsPresent(myFields)
if (myFields.nonEmpty) {
Some(TimeInForceRulesComponent(myFields.get(NoTimeInForceRulesField.TagId).flatMap(f=>NoTimeInForceRulesField.decode(f)),
if (nextTagPosLookup.contains(NoTimeInForceRulesField.TagId)) TimeInForceRulesGroup.decode(flds, nextTagPosLookup(NoTimeInForceRulesField.TagId)) else None))
} else None
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy