public class Group extends Object implements Iterable<GroupInstance>
| Modifier and Type | Method and Description |
|---|---|
Group |
addEntry()
Adds an entry to the end of the group.
|
Group |
addEntry(GroupInstance entry)
Adds an entry to the end of the group and fill using the provided entry.
|
boolean |
append(int tag,
int index,
StringBuilder builder)
Appends field value to the specified
StringBuilder. |
Group |
assemble(ByteBuffer buffer)
Assembles the repeating group to the target byte buffer.
|
Group |
assemble(FlatMessage flatMessage)
Assembles the FIX message to the target
FlatMessage. |
boolean |
contains(int tag,
int index)
Returns whether the field with the specified tag number is set.
|
boolean |
containsSame(int tag,
int index,
byte[] expectedValue,
int offset,
int length)
Returns whether the field corresponding to the given tag exists and have the same value.
|
boolean |
containsSame(int tag,
int index,
CharSequence expectedValue)
Returns whether the field corresponding to the given tag exists and have the same value.
|
String |
get(int tag,
int index)
Returns the field value as string.
|
boolean |
get(int tag,
int index,
ValuePtr value)
Returns field value as
ValuePtr using provided value object instance. |
BigDecimal |
getBigDecimal(int tag,
int index)
Returns the field value as
BigDecimal. |
byte[] |
getBytes(int tag,
int index)
Returns the field value as a byte array.
|
char |
getChar(int tag,
int index)
Returns the field value as character.
|
double |
getDouble(int tag,
int index)
Returns the field value as double.
|
GroupInstance |
getEntry(int index)
Returns the mentioned entry from the group.
|
int |
getEntryBeginningTag()
Returns tag number which identifies the beginning of new entry.
|
Group |
getGroup(int tag,
int index)
Returns the nested repeating group.
|
boolean |
getHighResolutionTimestamp(int tag,
int index,
HighResolutionTimestamp value,
TimestampFormat format)
Returns field value as
HighResolutionTimestamp using provided value object instance and parsed using
specified TimestampFormat format. |
HighResolutionTimestamp |
getHighResolutionTimestamp(int tag,
int index,
TimestampFormat format)
Returns field value as
HighResolutionTimestamp parsed using specified TimestampFormat format. |
int |
getInteger(int tag,
int index)
Returns the field value as integer.
|
int |
getLeadingTag()
Returns tag which identifies the number of repeating group entries.
|
long |
getLong(int tag,
int index)
Returns the field value as long.
|
int |
getNumberOfInstances()
Number of instances in the repeating group.
|
ScaledDecimal |
getScaledDecimal(int tag,
int index)
Returns field value as
ScaledDecimal. |
boolean |
getScaledDecimal(int tag,
int index,
ScaledDecimal value)
Returns field value as
ScaledDecimal using provided value object instance. |
LocalDateTime |
getUTCTimestamp(int tag,
int index)
Returns field value as
LocalDateTime. |
ValuePtr |
getValuePtr(int tag,
int index)
Returns field value as
ValuePtr. |
boolean |
hasFlag(int tag,
int index)
Returns the flag value.
|
boolean |
hasGroup(int tag,
int index)
Returns whether repeating group belongs to the fix block and actually exists.
|
Iterator<GroupInstance> |
iterator() |
boolean |
remove(int tag,
int index)
Removes the field with the specified tag number.
|
Group |
removeEntries()
Removes all the entries from the group including leading tag from parent.
|
Group |
removeEntry(int index)
Removes the mentioned entry from the group.
|
Group |
set(int tag,
int index,
BigDecimal value)
Sets the field value as
BigDecimal using provided value object instance. |
Group |
set(int tag,
int index,
byte[] buffer)
Sets the field value.
|
Group |
set(int tag,
int index,
byte[] buffer,
int valueLength)
Sets the field value.
|
Group |
set(int tag,
int index,
byte[] buffer,
int valueOffset,
int valueLength)
Sets the field value.
|
Group |
set(int tag,
int index,
ByteBuffer buffer)
Sets
ByteBuffer field value. |
Group |
set(int tag,
int index,
char value)
Sets the field value as character.
|
Group |
set(int tag,
int index,
CharSequence value)
Sets the field value as string.
|
Group |
set(int tag,
int index,
double value)
Sets the double field value.
|
Group |
set(int tag,
int index,
double value,
int precision)
Sets the field value as double.
|
Group |
set(int tag,
int index,
HighResolutionTimestamp value,
TimestampFormat format)
Sets the field value as
HighResolutionTimestamp formatting it using specified TimestampFormat format. |
Group |
set(int tag,
int index,
int value)
Sets the field value as integer.
|
Group |
set(int tag,
int index,
LocalDateTime value)
Sets the field value as
LocalDateTime formatting it to timestamp. |
Group |
set(int tag,
int index,
long value)
Sets the long field value.
|
Group |
set(int tag,
int index,
ScaledDecimal value)
Sets
ScaledDecimal field value. |
Group |
set(int tag,
int index,
ValuePtr value)
Sets
ValuePtr field value. |
Group |
setFlag(int tag,
int index,
boolean value)
Sets the flag tag value - "Y" or "N".
|
Group |
setGroup(Group srcGroup,
int index)
Copies an entire repeating group from one fix block to another.
|
Group |
setGroup(int tag,
int index,
int numberOfInstances)
Creates a new repeating group or changes the number of instances in the existing repeating group.
|
Group |
setTimestamp(int tag,
int index,
long timeMillis)
Sets the field value as timestamp.
|
Stream<GroupInstance> |
stream() |
String |
toString()
Returns string representation of the group.
|
String |
toString(char delimiter)
Returns string representation of the group using specified delimiter.
|
String |
toString(char delimiter,
Message.StringFormat format)
Returns string representation of the group using specified delimiter and format.
|
String |
toString(Message.StringFormat format)
Returns string representation of the group using specified format.
|
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic int getLeadingTag()
public int getEntryBeginningTag()
public int getNumberOfInstances()
public GroupInstance getEntry(int index)
index - index of the entry to be returned.public Group addEntry()
public Group addEntry(GroupInstance entry)
entry - entry to be used while filling newly added entry.public Group removeEntry(int index)
index - Index of the entry to be removed.public Group removeEntries()
public Group assemble(FlatMessage flatMessage)
FlatMessage.flatMessage - target FlatMessageNullPointerException - if flatMessage == nullpublic Group assemble(ByteBuffer buffer)
buffer - target byte bufferNullPointerException - if buffer == nullpublic boolean remove(int tag,
int index)
tag - field tag numberindex - index of the repeating group instance, starts from 0true if the field was found and removed, otherwise falseIllegalArgumentException - if (index < 0)public boolean contains(int tag,
int index)
tag - field tag numberindex - index of the repeating group instance, starts from 0true if the field is set,false if the field is not set or is not defined for this messageIllegalArgumentException - if (index < 0)public boolean containsSame(int tag,
int index,
CharSequence expectedValue)
tag - field tag numberindex - index of the repeating group instance, starts from 0expectedValue - expected valuetrue in case exits, false otherwiseIllegalArgumentException - if (index < 0)public boolean containsSame(int tag,
int index,
byte[] expectedValue,
int offset,
int length)
tag - field tag numberindex - index of the repeating group instance, starts from 0expectedValue - expected valueoffset - expected value offsetlength - expected value lengthtrue in case exits, false otherwiseIllegalArgumentException - if (index < 0)public char getChar(int tag,
int index)
contains(int,int).tag - field tag numberindex - index of the repeating group instance, starts from 0Character.MAX_VALUE if it is not setIllegalArgumentException - if (index < 0)ValueIsIncorrectException - if the value can't be parsed to intpublic Group set(int tag, int index, char value)
tag - field tag numberindex - index of the repeating group instance, starts from 0value - field valuecontains(int,int) to check if the field had a value.IllegalArgumentException - if (index < 0)TagNotDefinedForThisMessageTypeException - if field with the specified tag is not defined for this messagepublic int getInteger(int tag,
int index)
contains(int,int).tag - field tag numberindex - index of the repeating group instance, starts from 0Integer.MAX_VALUE if it is not setIllegalArgumentException - if (index < 0)ValueIsIncorrectException - if the value can't be parsed to intpublic Group set(int tag, int index, int value)
tag - field tag numberindex - index of the repeating group instance, starts from 0value - field valuecontains(int,int) to check if the field had a value.IllegalArgumentException - if (index < 0)TagNotDefinedForThisMessageTypeException - if field with the specified tag is not defined for this messagepublic long getLong(int tag,
int index)
contains(int, int).tag - field tag numberindex - repeating group instance index, starts from 0Long.MAX_VALUE if it is not setIllegalArgumentException - if (index < 0)ValueIsIncorrectException - if the value can't be parsed to longpublic Group set(int tag, int index, long value)
tag - field tag numberindex - index of the repeating group instance, starts from 0value - field valuecontains(int,int) to check if the field had a value.IllegalArgumentException - if (index < 0)TagNotDefinedForThisMessageTypeException - if field with the specified tag is not defined for this messagepublic double getDouble(int tag,
int index)
contains(int,int).
tag - field tag numberindex - index of the repeating group instance, starts from 0Double.NaN if it is not setIllegalArgumentException - if (index < 0)ValueIsIncorrectException - if the value can't be parsed to doublepublic Group set(int tag, int index, double value)
tag - field tag numberindex - index of the repeating group instance, starts from 0value - field valuecontains(int,int) to check if the field had a value.IllegalArgumentException - if (index < 0)TagNotDefinedForThisMessageTypeException - if field with the specified tag is not defined for this messagepublic Group set(int tag, int index, double value, int precision)
tag - field tag numberindex - index of the repeating group instance, starts from 0value - field valueprecision - the number of digits in decimal partcontains(int,int) to check if the field had a value.IllegalArgumentException - if (index < 0)TagNotDefinedForThisMessageTypeException - if field with the specified tag is not defined for this messageIllegalArgumentException - if (index < 0)public BigDecimal getBigDecimal(int tag, int index)
BigDecimal.
contains(int,int).tag - field tag numberindex - index of the repeating group instance, starts from 0BigDecimal, null if it is not setIllegalArgumentException - if (index < 0)ValueIsIncorrectException - if the value can't be parsed to BigDecimalpublic Group set(int tag, int index, BigDecimal value)
BigDecimal using provided value object instance.tag - field tag numberindex - index of the repeating group instance, starts from 0value - field valuecontains(int,int) to check if the field had a value.IllegalArgumentException - if (index < 0)TagNotDefinedForThisMessageTypeException - if field with the specified tag is not defined for this messageNullPointerException - if (value == null)public ScaledDecimal getScaledDecimal(int tag, int index)
ScaledDecimal.tag - field tag numberindex - repeating group instance index, starts from 0null if it is not availableIllegalArgumentException - if (index < 0)ValueIsIncorrectException - if the field value can't be parsed to ScaledDecimalpublic boolean getScaledDecimal(int tag,
int index,
ScaledDecimal value)
ScaledDecimal using provided value object instance.tag - field tag numberindex - repeating group instance index, starts from 0value - field valueIllegalArgumentException - if (index < 0)NullPointerException - if (value == null)ValueIsIncorrectException - if the field value can't be parsed to ScaledDecimalpublic Group set(int tag, int index, ScaledDecimal value)
ScaledDecimal field value.tag - field tag numberindex - repeating group instance index, starts from 0value - field valuecontains(int,int) to check if the field had a value.IllegalArgumentException - if (index < 0)NullPointerException - if (value == null)TagNotDefinedForThisMessageTypeException - if field with the specified tag is not defined for this messagepublic LocalDateTime getUTCTimestamp(int tag, int index)
LocalDateTime.tag - field tag numberindex - repeating group instance index, starts from 0null if it is not availableIllegalArgumentException - if (index < 0)ValueIsIncorrectException - if the field value can't be parsed to LocalDateTimepublic Group setTimestamp(int tag, int index, long timeMillis)
tag - field tag numberindex - repeating group instance index, starts from 0timeMillis - time in millisecondscontains(int,int) to check if the field had a value.IllegalArgumentException - if (index < 0)TagNotDefinedForThisMessageTypeException - if field with the specified tag is not defined for this messagepublic Group set(int tag, int index, LocalDateTime value)
LocalDateTime formatting it to timestamp.tag - field tag numberindex - repeating group instance index, starts from 0value - field valuecontains(int,int) to check if the field had a value.IllegalArgumentException - if (index < 0)NullPointerException - if (value == null)TagNotDefinedForThisMessageTypeException - if field with the specified tag is not defined for this messagepublic HighResolutionTimestamp getHighResolutionTimestamp(int tag, int index, TimestampFormat format)
HighResolutionTimestamp parsed using specified TimestampFormat format.tag - field tag numberindex - repeating group instance index, starts from 0format - format to be used during parsingnull if it is not availableIllegalArgumentException - if (index < 0)ValueIsIncorrectException - if the field value can't be parsed to HighResolutionTimestamp with
specified TimestampFormat formatpublic boolean getHighResolutionTimestamp(int tag,
int index,
HighResolutionTimestamp value,
TimestampFormat format)
HighResolutionTimestamp using provided value object instance and parsed using
specified TimestampFormat format.tag - field tag numberindex - repeating group instance index, starts from 0value - field valueformat - format to be used during parsingIllegalArgumentException - if (index < 0)NullPointerException - if ("value == null")ValueIsIncorrectException - if the field value can't be parsed to HighResolutionTimestamp with
specified TimestampFormat formatpublic Group set(int tag, int index, HighResolutionTimestamp value, TimestampFormat format)
HighResolutionTimestamp formatting it using specified TimestampFormat format.tag - field tag numberindex - repeating group instance index, starts from 0value - field valueformat - format to be used for formattingcontains(int,int) to check if the field had a value.IllegalArgumentException - if (index < 0)NullPointerException - if (value == null)TagNotDefinedForThisMessageTypeException - if field with the specified tag is not defined for this message
and unknown fields are disabledpublic String get(int tag, int index)
tag - field tag numberindex - index of the repeating group instance, starts from 0null if it is not setIllegalArgumentException - if (index < 0)public Group set(int tag, int index, CharSequence value)
tag - field tag numberindex - index of the repeating group instance, starts from 0value - field valuecontains(int,int) to check if the field had a value.IllegalArgumentException - if (index < 0)TagNotDefinedForThisMessageTypeException - if field with the specified tag is not defined for this messageNullPointerException - if (value == null)public ValuePtr getValuePtr(int tag, int index)
ValuePtr.
tag - field tag numberindex - repeating group instance index, starts from 0ValuePtr.isSet() to check whether value is setIllegalArgumentException - if (index < 0)public boolean get(int tag,
int index,
ValuePtr value)
ValuePtr using provided value object instance.
tag - field tag numberindex - repeating group instance index, starts from 0value - pointer to pass valueIllegalArgumentException - if (index < 0)public Group set(int tag, int index, ValuePtr value)
ValuePtr field value.tag - field tag numberindex - repeating group instance index, starts from 0value - value pointercontains(int,int) to check if the field had a value.IllegalArgumentException - if (index < 0)TagNotDefinedForThisMessageTypeException - if field with the specified tag is not defined for this messageNullPointerException - if (valuePtr == null)IllegalArgumentException - if !valuePtr.isSet()public Group set(int tag, int index, ByteBuffer buffer)
ByteBuffer field value.tag - field tag numberindex - index of the repeating group instance, starts from 0buffer - field valuecontains(int,int) to check if the field had a value.IllegalArgumentException - if (index < 0)TagNotDefinedForThisMessageTypeException - if field with the specified tag is not defined for this messageNullPointerException - if (buffer == null)public byte[] getBytes(int tag,
int index)
tag - field tag numberindex - index of the repeating group instance, starts from 0null if it is not setIllegalArgumentException - if (index < 0)public Group set(int tag, int index, byte[] buffer)
tag - field tag numberindex - index of the repeating group instance, starts from 0buffer - byte buffercontains(int,int) to check if the field had a value.IllegalArgumentException - if (index < 0)TagNotDefinedForThisMessageTypeException - if field with the specified tag is not defined for this messageNullPointerException - if (buffer == null)public Group set(int tag, int index, byte[] buffer, int valueLength)
tag - field tag numberindex - repeating group instance index, starts from 0buffer - byte buffervalueLength - value length in the buffercontains(int,int) to check if the field had a value.IllegalArgumentException - if (index < 0)TagNotDefinedForThisMessageTypeException - if field with the specified tag is not defined for this message
and unknown fields are disabledNullPointerException - if (buffer == null)IllegalArgumentException - (length > buffer.length or (valueLength < 0)public Group set(int tag, int index, byte[] buffer, int valueOffset, int valueLength)
tag - field tag numberindex - repeating group instance index, starts from 0buffer - byte buffervalueOffset - value offset in the buffervalueLength - value length in the buffercontains(int,int) to check if the field had a value.IllegalArgumentException - if (index < 0)TagNotDefinedForThisMessageTypeException - if field with the specified tag is not defined for this messageNullPointerException - if (buffer == null)IllegalArgumentException - (valueOffset < 0) or (valueOffset + valueLength > buffer.length)
or (valueLength < 0)public boolean append(int tag,
int index,
StringBuilder builder)
StringBuilder.tag - field tag numberindex - repeating group instance index, starts from 0builder - string builder value of the field to be appendedtrue if the value was appended, and false otherwiseNullPointerException - if (buffer == null)public boolean hasFlag(int tag,
int index)
tag - field tag numberindex - repeating group instance index, starts from 0IllegalArgumentException - if (index < 0)public Group setFlag(int tag, int index, boolean value)
tag - field tag numberindex - repeating group instance index, starts from 0value - true for "Y", false for "N"contains(int,int) to check if the field had a value.IllegalArgumentException - if (index < 0)TagNotDefinedForThisMessageTypeException - if field with the specified tag is not defined for this messagepublic boolean hasGroup(int tag,
int index)
tag - tag number of the field that defines the number of instances in this repeating group (the NoXXX field)index - index of the repeating group instance, starts from 0true in case repeating group belongs to the fix block and actually exists, false otherwiseIllegalArgumentException - if (index < 0)public Group getGroup(int tag, int index)
tag - tag number of the field that defines the number of instances in this repeating group (the NoXXX field)index - index of the repeating group instance, starts from 0IllegalArgumentException - if (index < 0)ParserException - tag number does not belong to the grouppublic Group setGroup(int tag, int index, int numberOfInstances)
tag - tag number of the field that defines the number of instances in this repeating group (the NoXXX field)index - index of the repeating group instance, starts from 0numberOfInstances - number of instances in the repeating groupIllegalArgumentException - if (index < 0)TagNotDefinedForThisMessageTypeException - if field with the specified tag is not defined for this messagepublic Group setGroup(Group srcGroup, int index)
srcGroup - source group to be copiedindex - index of the repeating group instance, starts from 0NullPointerException - if (srcGroup == null)public Iterator<GroupInstance> iterator()
iterator in interface Iterable<GroupInstance>public String toString()
Message.StringFormat.TAG_NUMBER.
Default delimiter is FixParserUtil.DELIM_CHAR.public String toString(char delimiter)
Message.StringFormat.TAG_NUMBER.delimiter - delimiter to usepublic String toString(Message.StringFormat format)
FixParserUtil.DELIM_CHAR.format - format to useNullPointerException - if (null == format)public String toString(char delimiter, Message.StringFormat format)
format - format to usedelimiter - delimiter to useNullPointerException - if (null == format)public Stream<GroupInstance> stream()
Copyright © 2005–2025 Onix Solutions. All rights reserved.