Constructor and Description |
---|
FlatMessage()
Constructor, empty message will be initialized and ready for interaction.
|
FlatMessage(byte[] rawFixMessage,
int length)
Constructor, given raw FIX message will be parsed and ready for interaction.
|
FlatMessage(FlatMessage flatMessage)
Copy constructor.
|
Modifier and Type | Method and Description |
---|---|
FlatMessage |
add(int tag,
BigDecimal value)
Adds given tag/value pair at the end of flat message.
|
FlatMessage |
add(int tag,
byte[] value)
Adds given tag/value pair at the end of flat message.
|
FlatMessage |
add(int tag,
byte[] value,
int offset,
int length)
Adds given tag/value pair at the end of flat message.
|
FlatMessage |
add(int tag,
ByteBuffer value)
Adds given tag/value pair at the end of flat message.
|
FlatMessage |
add(int tag,
char value)
Adds given tag/value pair at the end of flat message.
|
FlatMessage |
add(int tag,
CharSequence value)
Adds given tag/value pair at the end of flat message.
|
FlatMessage |
add(int tag,
double value,
int precision)
Adds given tag/value pair at the end of flat message.
|
FlatMessage |
add(int tag,
HighResolutionTimestamp value,
TimestampFormat format)
Adds given tag/value pair at the end of flat message.
|
FlatMessage |
add(int tag,
int value)
Adds given tag/value pair at the end of flat message.
|
FlatMessage |
add(int index,
int tag,
byte[] value)
Adds given tag/value pair at the specified index of flat message.
|
FlatMessage |
add(int index,
int tag,
byte[] value,
int offset,
int length)
Adds given tag/value pair at the specified index of flat message.
|
FlatMessage |
add(int index,
int tag,
CharSequence value)
Adds given tag/value pair at the specified index of flat message.
|
FlatMessage |
add(int index,
int tag,
ValuePtr value)
Adds given tag/value pair at the specified index of flat message.
|
FlatMessage |
add(int tag,
LocalDateTime value)
Adds given tag/value pair at the end of flat message.
|
FlatMessage |
add(int tag,
long value)
Adds given tag/value pair at the end of flat message.
|
FlatMessage |
add(int tag,
ScaledDecimal value)
Adds given tag/value pair at the end of flat message.
|
FlatMessage |
add(int tag,
ValuePtr value)
Adds given tag/value pair at the end of flat message.
|
FlatMessage |
addFlag(int tag,
boolean value)
Adds given tag/value("Y" or "N") pair at the end of flat message.
|
FlatMessage |
addFlag(int index,
int tag,
boolean value)
Adds given tag/value("Y" or "N") pair at the specified index of flat message.
|
FlatMessage |
addTimestamp(int tag,
long timeMillis)
Adds given tag/value pair at the end of flat message.
|
boolean |
append(int tag,
StringBuilder builder)
Appends field value to the specified
StringBuilder . |
void |
assemble(ByteBuffer rawMsg)
Assembles the FIX message to the given buffer.
|
boolean |
checkType(char expectedType)
Checks whether the message have the specified MsgType(35).
|
boolean |
checkType(CharSequence expectedType)
Checks whether the message have the specified MsgType(35).
|
boolean |
contains(int tag)
Returns whether the field corresponding to the given tag exists.
|
boolean |
containsSame(int tag,
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,
CharSequence expectedValue)
Returns whether the field corresponding to the given tag exists and have the same value.
|
int |
findIndex(int tag)
Find field index corresponding to the given tag.
|
int |
findIndex(int tag,
int hintPosition)
Find field index corresponding to the given tag.
|
String |
get(int tag)
Returns the field value by the given tag.
|
boolean |
get(int tag,
Field field)
Fills the given
Field with reference to value by the given tag. |
boolean |
get(int tag,
Field field,
int hintPosition)
Fills the given
Field with reference to value by the given tag. |
boolean |
get(int tag,
HighResolutionTimestamp value,
TimestampFormat format)
Fills the given
HighResolutionTimestamp with value by the given tag. |
boolean |
get(int tag,
HighResolutionTimestamp value,
TimestampFormat format,
int hintPosition)
Fills the given
HighResolutionTimestamp with value by the given tag. |
String |
get(int tag,
int hintPosition)
Returns the field value by the given tag.
|
boolean |
get(int tag,
ScaledDecimal value)
Fills the given
ScaledDecimal with value by the given tag. |
boolean |
get(int tag,
ScaledDecimal value,
int hintPosition)
Fills the given
ScaledDecimal with value by the given tag. |
boolean |
get(int tag,
ValuePtr valuePtr)
Fills the given
ValuePtr with reference to value by the given tag. |
boolean |
get(int tag,
ValuePtr valuePtr,
int hintPosition)
Fills the given
ValuePtr with reference to value by the given tag. |
BigDecimal |
getBigDecimal(int tag)
Returns the field value by the given tag.
|
BigDecimal |
getBigDecimal(int tag,
int hintPosition)
Returns the field value by the given tag.
|
String |
getByIndex(int index)
Returns the field value at the given field index.
|
boolean |
getByIndex(int index,
Field field)
Fills the field with tag/value from the given field index.
|
boolean |
getByIndex(int index,
HighResolutionTimestamp value,
TimestampFormat format)
Fills the given
HighResolutionTimestamp with value by the given tag. |
boolean |
getByIndex(int index,
ScaledDecimal value)
Fills the given
ScaledDecimal with value by the given tag. |
boolean |
getByIndex(int index,
ValuePtr valuePtr)
Fills the given
ValuePtr with reference to value from the given field index. |
BigDecimal |
getByIndexBigDecimal(int index)
Returns the field value at the given field index.
|
char |
getByIndexChar(int index)
Returns the field value at the given field index.
|
double |
getByIndexDouble(int index)
Returns the field value at the given field index.
|
HighResolutionTimestamp |
getByIndexHighResolutionTimestamp(int index,
TimestampFormat format)
Returns the field value at the given field index.
|
int |
getByIndexInteger(int index)
Returns the field value at the given field index.
|
long |
getByIndexLong(int index)
Returns the field value at the given field index.
|
ScaledDecimal |
getByIndexScaledDecimal(int index)
Returns the field value at the given field index.
|
LocalDateTime |
getByIndexUTCTimestamp(int index)
Returns the field value at the given field index.
|
char |
getChar(int tag)
Returns the field value by the given tag.
|
char |
getChar(int tag,
int hintPosition)
Returns the field value by the given tag.
|
double |
getDouble(int tag)
Returns the field value by the given tag.
|
double |
getDouble(int tag,
int hintPosition)
Returns the field value by the given tag.
|
HighResolutionTimestamp |
getHighResolutionTimestamp(int tag,
TimestampFormat format)
Returns the field value by the given tag.
|
HighResolutionTimestamp |
getHighResolutionTimestamp(int tag,
TimestampFormat format,
int hintPosition)
Returns the field value by the given tag.
|
int |
getInteger(int tag)
Returns the field value by the given tag.
|
int |
getInteger(int tag,
int hintPosition)
Returns the field value by the given tag.
|
long |
getLong(int tag)
Returns the field value by the given tag.
|
long |
getLong(int tag,
int hintPosition)
Returns the field value by the given tag.
|
int |
getNumberOfFields()
Return number of tag/value pairs.
|
ScaledDecimal |
getScaledDecimal(int tag)
Returns the field value by the given tag.
|
ScaledDecimal |
getScaledDecimal(int tag,
int hintPosition)
Returns the field value by the given tag.
|
int |
getTagByIndex(int index)
Returns the field tag at the given field index.
|
LocalDateTime |
getUTCTimestamp(int tag)
Returns the field value by the given tag.
|
LocalDateTime |
getUTCTimestamp(int tag,
int hintPosition)
Returns the field value by the given tag.
|
ArrayList<String> |
getValues(int tag)
Returns all the values for all occurrences of a particular tag.
|
void |
getValues(int tag,
List<String> list)
Adds all the values for all occurrences of a particular tag to the given list.
|
boolean |
hasFlag(int tag)
Returns the flag value by the given tag.
|
Iterator<Field> |
iterator() |
FlatMessage |
remove()
Removes the last field.
|
boolean |
remove(int tag)
Removes the field corresponding to the given tag.
|
void |
removeByIndex(int index)
Removes the field at the given field index.
|
void |
reset()
Resets the flat message.
|
void |
reset(byte[] rawFixMessage,
int length)
Resets the flat message with the given raw FIX message, allows to re-use internal data structures.
|
void |
reset(FlatMessage flatMessage)
Resets the flat message with the given one, allows to re-use internal data structures.
|
FlatMessage |
set(int tag,
BigDecimal value)
Sets new value for the given tag.
|
FlatMessage |
set(int tag,
byte[] value)
Sets new value for the given tag.
|
FlatMessage |
set(int tag,
byte[] value,
int offset,
int length)
Sets new value for the given tag.
|
FlatMessage |
set(int tag,
ByteBuffer value)
Sets new value at the given field index.
|
FlatMessage |
set(int tag,
char value)
Sets new value for the given tag.
|
FlatMessage |
set(int tag,
CharSequence value)
Sets new value for the given tag.
|
FlatMessage |
set(int tag,
double value,
int precision)
Sets new value for the given tag.
|
FlatMessage |
set(int tag,
HighResolutionTimestamp value,
TimestampFormat format)
Sets new value for the given tag.
|
FlatMessage |
set(int tag,
int value)
Sets new value for the given tag.
|
FlatMessage |
set(int tag,
LocalDateTime value)
Sets new value for the given tag.
|
FlatMessage |
set(int tag,
long value)
Sets new value for the given tag.
|
FlatMessage |
set(int tag,
ScaledDecimal value)
Sets new value for the given tag.
|
FlatMessage |
set(int tag,
ValuePtr value)
Sets new value for the given tag.
|
FlatMessage |
setByIndex(int index,
BigDecimal value)
Sets new value at the given field index.
|
FlatMessage |
setByIndex(int index,
byte[] value)
Sets new value at the given field index.
|
FlatMessage |
setByIndex(int index,
byte[] value,
int offset,
int length)
Sets new value at the given field index.
|
FlatMessage |
setByIndex(int index,
ByteBuffer value)
Sets new value at the given field index.
|
FlatMessage |
setByIndex(int index,
char value)
Sets new value at the given field index.
|
FlatMessage |
setByIndex(int index,
CharSequence value)
Sets new value at the given field index.
|
FlatMessage |
setByIndex(int index,
double value,
int precision)
Sets new value at the given field index.
|
FlatMessage |
setByIndex(int index,
HighResolutionTimestamp value,
TimestampFormat format)
Sets new value at the given field index.
|
FlatMessage |
setByIndex(int index,
int value)
Sets new value at the given field index.
|
FlatMessage |
setByIndex(int index,
LocalDateTime value)
Sets new value at the given field index.
|
FlatMessage |
setByIndex(int index,
long value)
Sets new value at the given field index.
|
FlatMessage |
setByIndex(int index,
ScaledDecimal value)
Sets new value at the given field index.
|
FlatMessage |
setByIndex(int index,
ValuePtr value)
Sets new value at the given field index.
|
FlatMessage |
setFlag(int tag,
boolean value)
Sets new value for the given tag.
|
FlatMessage |
setFlagByIndex(int index,
boolean value)
Sets new value at the given field index.
|
FlatMessage |
setTimestamp(int tag,
long timeMillis)
Sets new value for the given tag as timestamp.
|
FlatMessage |
setTimestampByIndex(int index,
long timeMillis)
Sets new value at the given field index as timestamp.
|
Stream<Field> |
stream()
Returns stream that contains all fields of the message.
|
String |
toString() |
void |
toString(StringBuilder builder)
Fills
StringBuilder with the string representation of the object. |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public FlatMessage()
public FlatMessage(byte[] rawFixMessage, int length)
rawFixMessage
- raw FIX message in the tag=value formlength
- the message length in bytespublic FlatMessage(FlatMessage flatMessage)
flatMessage
- source flat message to be copiedpublic final void reset()
public final void reset(byte[] rawFixMessage, int length)
rawFixMessage
- raw FIX message in the tag=value formlength
- the message length in bytespublic final void reset(FlatMessage flatMessage)
flatMessage
- source flat message to be copiedpublic final void assemble(ByteBuffer rawMsg)
Note: The fields order should comply with the FIX Protocol requirements: the first field should be BeginString, the second field should be BodyLength.
Note: If the last field is not CheckSum then it will be added.
Note: This method updates both BodyLength and CheckSum values.
rawMsg
- target byte bufferpublic final FlatMessage add(int tag, char value)
Note: Tag/value pair can be added multiple times, for example to build up a repeating group.
tag
- field tagvalue
- field value represented as char
public final FlatMessage add(int tag, int value)
Note: Tag/value pair can be added multiple times, for example to build up a repeating group.
tag
- field tagvalue
- field value represented as int
public final FlatMessage add(int tag, long value)
Note: Tag/value pair can be added multiple times, for example to build up a repeating group.
tag
- field tagvalue
- field value represented as long
public final FlatMessage add(int tag, double value, int precision)
Note: Tag/value pair can be added multiple times, for example to build up a repeating group.
tag
- field tagvalue
- field value represented as double
precision
- the number of digits in decimal partpublic final FlatMessage add(int tag, BigDecimal value)
Note: Tag/value pair can be added multiple times, for example to build up a repeating group.
tag
- field tagvalue
- field value represented as BigDecimal
public final FlatMessage add(int tag, ScaledDecimal value)
Note: Tag/value pair can be added multiple times, for example to build up a repeating group.
tag
- field tagvalue
- field value represented as ScaledDecimal
public final FlatMessage add(int tag, LocalDateTime value)
Note: Tag/value pair can be added multiple times, for example to build up a repeating group.
tag
- field tagvalue
- field value represented as LocalDateTime
public final FlatMessage add(int tag, HighResolutionTimestamp value, TimestampFormat format)
Note: Tag/value pair can be added multiple times, for example to build up a repeating group.
tag
- field tagvalue
- field value represented as HighResolutionTimestamp
format
- format to be used during parsingpublic final FlatMessage add(int tag, CharSequence value)
Note: Tag/value pair can be added multiple times, for example to build up a repeating group.
tag
- field tagvalue
- field value represented as CharSequence
public final FlatMessage add(int tag, ValuePtr value)
Note: Tag/value pair can be added multiple times, for example to build up a repeating group.
tag
- field tagvalue
- field value represented as ValuePtr
public final FlatMessage add(int tag, byte[] value)
Note: Tag/value pair can be added multiple times, for example to build up a repeating group.
tag
- field tagvalue
- field value represented as byte[]
public final FlatMessage add(int tag, byte[] value, int offset, int length)
Note: Tag/value pair can be added multiple times, for example to build up a repeating group.
tag
- field tagvalue
- field value represented as byte[]
offset
- value offsetlength
- value lengthpublic final FlatMessage add(int tag, ByteBuffer value)
Note: Tag/value pair can be added multiple times, for example to build up a repeating group.
tag
- field tagvalue
- field value represented as ByteBuffer
public FlatMessage addFlag(int tag, boolean value)
Note: Tag/value pair can be added multiple times, for example to build up a repeating group.
tag
- field tagvalue
- field value represented as boolean
true
for "Y", false
for "N"public FlatMessage addTimestamp(int tag, long timeMillis)
Note: Tag/value pair can be added multiple times, for example to build up a repeating group.
tag
- field tagtimeMillis
- time in millisecondspublic final FlatMessage add(int index, int tag, CharSequence value)
index
- field to be added at the indextag
- field tagvalue
- field value represented as CharSequence
IndexNotFoundException
- if the index is invalid.public final FlatMessage add(int index, int tag, ValuePtr value)
index
- field to be added at the indextag
- field tagvalue
- field value represented as ValuePtr
IndexNotFoundException
- if the index is invalid.public final FlatMessage add(int index, int tag, byte[] value)
index
- field to be added at the indextag
- field tagvalue
- field value represented as byte[]
IndexNotFoundException
- if the index is invalid.public final FlatMessage add(int index, int tag, byte[] value, int offset, int length)
index
- field to be added at the indextag
- field tagvalue
- field value represented as byte[]
offset
- value offsetlength
- value lengthIndexNotFoundException
- if the index is invalid.public final FlatMessage addFlag(int index, int tag, boolean value)
index
- field to be added at the indextag
- field tagvalue
- field value represented as boolean
true
for "Y", false
for "N"IndexNotFoundException
- if the index is invalid.public final FlatMessage set(int tag, char value)
Note: If there are multiple tag/value pairs corresponding to the given tag it will update the first one only.
tag
- field tagvalue
- field value represented as char
TagNotFoundException
- in case the given tag does not exist in the flat message.public final FlatMessage set(int tag, int value)
Note: If there are multiple tag/value pairs corresponding to the given tag it will update the first one only.
tag
- field tagvalue
- field value represented as int
TagNotFoundException
- in case the given tag does not exist in the flat message.public final FlatMessage set(int tag, long value)
Note: If there are multiple tag/value pairs corresponding to the given tag it will update the first one only.
tag
- field tagvalue
- field value represented as long
TagNotFoundException
- in case the given tag does not exist in the flat message.public final FlatMessage set(int tag, double value, int precision)
Note: If there are multiple tag/value pairs corresponding to the given tag it will update the first one only.
tag
- field tagvalue
- field value represented as double
precision
- the number of digits in decimal partTagNotFoundException
- in case the given tag does not exist in the flat message.public final FlatMessage set(int tag, BigDecimal value)
Note: If there are multiple tag/value pairs corresponding to the given tag it will update the first one only.
tag
- field tagvalue
- field value represented as BigDecimal
TagNotFoundException
- in case the given tag does not exist in the flat message.public final FlatMessage set(int tag, ScaledDecimal value)
Note: If there are multiple tag/value pairs corresponding to the given tag it will update the first one only.
tag
- field tagvalue
- field value represented as ScaledDecimal
TagNotFoundException
- in case the given tag does not exist in the flat message.public final FlatMessage set(int tag, LocalDateTime value)
Note: If there are multiple tag/value pairs corresponding to the given tag it will update the first one only.
tag
- field tagvalue
- field value represented as LocalDateTime
TagNotFoundException
- in case the given tag does not exist in the flat message.public final FlatMessage set(int tag, HighResolutionTimestamp value, TimestampFormat format)
Note: If there are multiple tag/value pairs corresponding to the given tag it will update the first one only.
tag
- field tagvalue
- field value represented as HighResolutionTimestamp
format
- format to be used during parsingTagNotFoundException
- in case the given tag does not exist in the flat message.public final FlatMessage set(int tag, CharSequence value)
Note: If there are multiple tag/value pairs corresponding to the given tag it will update the first one only.
tag
- field tagvalue
- field value represented as CharSequence
TagNotFoundException
- in case the given tag does not exist in the flat message.public final FlatMessage set(int tag, ValuePtr value)
Note: If there are multiple tag/value pairs corresponding to the given tag it will update the first one only.
tag
- field tagvalue
- field value represented as ValuePtr
TagNotFoundException
- in case the given tag does not exist in the flat message.public final FlatMessage set(int tag, byte[] value)
Note: If there are multiple tag/value pairs corresponding to the given tag it will update the first one only.
tag
- field tagvalue
- field value represented as byte[]
TagNotFoundException
- in case the given tag does not exist in the flat message.public final FlatMessage set(int tag, byte[] value, int offset, int length)
Note: If there are multiple tag/value pairs corresponding to the given tag it will update the first one only.
tag
- field tagvalue
- field value represented as byte[]
offset
- value offsetlength
- value lengthTagNotFoundException
- in case the given tag does not exist in the flat message.public final FlatMessage set(int tag, ByteBuffer value)
Note: If there are multiple tag/value pairs corresponding to the given tag it will update the first one only.
tag
- field tagvalue
- field value represented as ByteBuffer
IndexNotFoundException
- if the index is invalid.public final FlatMessage setFlag(int tag, boolean value)
Note: If there are multiple tag/value pairs corresponding to the given tag it will update the first one only.
tag
- field tagvalue
- field value represented as boolean
true
for "Y", false
for "N"TagNotFoundException
- in case the given tag does not exist in the flat message.public final FlatMessage setTimestamp(int tag, long timeMillis)
Note: If there are multiple tag/value pairs corresponding to the given tag it will update the first one only.
tag
- field tag numbertimeMillis
- time in millisecondspublic final FlatMessage setByIndex(int index, char value)
Note:
Field index can be found using findIndex(int)
method.
index
- index of tag/value pair to be updatedvalue
- field value represented as char
IndexNotFoundException
- if the index is invalid.public final FlatMessage setByIndex(int index, int value)
Note:
Field index can be found using findIndex(int)
method.
index
- index of tag/value pair to be updatedvalue
- field value represented as int
IndexNotFoundException
- if the index is invalid.public final FlatMessage setByIndex(int index, long value)
Note:
Field index can be found using findIndex(int)
method.
index
- index of tag/value pair to be updatedvalue
- field value represented as long
IndexNotFoundException
- if the index is invalid.public final FlatMessage setByIndex(int index, double value, int precision)
Note:
Field index can be found using findIndex(int)
method.
index
- index of tag/value pair to be updatedvalue
- field value represented as double
precision
- the number of digits in decimal partIndexNotFoundException
- if the index is invalid.public final FlatMessage setByIndex(int index, BigDecimal value)
Note:
Field index can be found using findIndex(int)
method.
index
- index of tag/value pair to be updatedvalue
- field value represented as BigDecimal
IndexNotFoundException
- if the index is invalid.public final FlatMessage setByIndex(int index, ScaledDecimal value)
Note:
Field index can be found using findIndex(int)
method.
index
- index of tag/value pair to be updatedvalue
- field value represented as ScaledDecimal
IndexNotFoundException
- if the index is invalid.public final FlatMessage setByIndex(int index, LocalDateTime value)
Note:
Field index can be found using findIndex(int)
method.
index
- index of tag/value pair to be updatedvalue
- field value represented as LocalDateTime
IndexNotFoundException
- if the index is invalid.public final FlatMessage setByIndex(int index, HighResolutionTimestamp value, TimestampFormat format)
Note:
Field index can be found using findIndex(int)
method.
index
- index of tag/value pair to be updatedvalue
- field value represented as HighResolutionTimestamp
format
- format to be used during parsingIndexNotFoundException
- if the index is invalid.public final FlatMessage setByIndex(int index, CharSequence value)
Note:
Field index can be found using findIndex(int)
method.
index
- index of tag/value pair to be updatedvalue
- field value represented as CharSequence
IndexNotFoundException
- if the index is invalid.public final FlatMessage setByIndex(int index, ValuePtr value)
Note:
Field index can be found using findIndex(int)
method.
index
- index of tag/value pair to be updatedvalue
- field value represented as ValuePtr
IndexNotFoundException
- if the index is invalid.public final FlatMessage setByIndex(int index, byte[] value)
Note:
Field index can be found using findIndex(int)
method.
index
- index of tag/value pair to be updatedvalue
- field value represented as byte[]
IndexNotFoundException
- if the index is invalid.public final FlatMessage setByIndex(int index, byte[] value, int offset, int length)
Note:
Field index can be found using findIndex(int)
method.
index
- index of tag/value pair to be updatedvalue
- field value represented as byte[]
offset
- value offsetlength
- value lengthIndexNotFoundException
- if the index is invalid.public final FlatMessage setByIndex(int index, ByteBuffer value)
Note:
Field index can be found using findIndex(int)
method.
index
- index of tag/value pair to be updatedvalue
- field value represented as ByteBuffer
IndexNotFoundException
- if the index is invalid.public final FlatMessage setFlagByIndex(int index, boolean value)
Note:
Field index can be found using findIndex(int)
method.
index
- index of tag/value pair to be updatedvalue
- field value represented as boolean
true
for "Y", false
for "N"IndexNotFoundException
- if the index is invalid.public final FlatMessage setTimestampByIndex(int index, long timeMillis)
Note:
Field index can be found using findIndex(int)
method.
index
- index of tag/value pair to be updatedtimeMillis
- time in millisecondspublic final char getChar(int tag)
tag
- field tagCharacter.MAX_VALUE
if it is not found.ValueIsIncorrectException
- if the value is not a charpublic final int getInteger(int tag)
tag
- field tagInteger.MAX_VALUE
if it is not found.ValueIsIncorrectException
- if the value can't be parsed to intpublic final long getLong(int tag)
tag
- field tagLong.MAX_VALUE
if it is not found.ValueIsIncorrectException
- if the value can't be parsed to longpublic final double getDouble(int tag)
tag
- field tagDouble.NaN
if it is not found.ValueIsIncorrectException
- if the value can't be parsed to doublepublic final BigDecimal getBigDecimal(int tag)
tag
- field tagnull
if it is not found.ValueIsIncorrectException
- if the value can't be parsed to BigDecimal
public final ScaledDecimal getScaledDecimal(int tag)
tag
- field tagnull
if it is not found.ValueIsIncorrectException
- if the value can't be parsed to ScaledDecimal
public final LocalDateTime getUTCTimestamp(int tag)
tag
- field tagnull
if it is not found.ValueIsIncorrectException
- if the value can't be parsed to LocalDateTime
public final HighResolutionTimestamp getHighResolutionTimestamp(int tag, TimestampFormat format)
tag
- field tagformat
- format to be used during parsingnull
if it is not found.ValueIsIncorrectException
- if the field value can't be parsed to HighResolutionTimestamp
with
specified TimestampFormat
formatpublic final String get(int tag)
tag
- field tagpublic final boolean get(int tag, ScaledDecimal value)
ScaledDecimal
with value by the given tag.tag
- field tagvalue
- object to be filledValueIsIncorrectException
- if the value can't be parsed to ScaledDecimal
public final boolean get(int tag, HighResolutionTimestamp value, TimestampFormat format)
HighResolutionTimestamp
with value by the given tag.tag
- field tagvalue
- object to be filledformat
- format to be used during parsingValueIsIncorrectException
- if the field value can't be parsed to HighResolutionTimestamp
with
specified TimestampFormat
formatpublic final boolean get(int tag, Field field)
Field
with reference to value by the given tag.tag
- field tagfield
- field to be filledpublic final boolean get(int tag, ValuePtr valuePtr)
ValuePtr
with reference to value by the given tag.tag
- field tagvaluePtr
- field value reference to be filledpublic final char getChar(int tag, int hintPosition)
tag
- field taghintPosition
- The search will be started from this positionCharacter.MAX_VALUE
if it is not found.ValueIsIncorrectException
- if the value is not a charpublic final int getInteger(int tag, int hintPosition)
tag
- field taghintPosition
- The search will be started from this positionInteger.MAX_VALUE
if it is not found.ValueIsIncorrectException
- if the value can't be parsed to intpublic final long getLong(int tag, int hintPosition)
tag
- field taghintPosition
- The search will be started from this positionLong.MAX_VALUE
if it is not found.ValueIsIncorrectException
- if the value can't be parsed to longpublic final double getDouble(int tag, int hintPosition)
tag
- field taghintPosition
- The search will be started from this positionDouble.NaN
if it is not found.ValueIsIncorrectException
- if the value can't be parsed to doublepublic final BigDecimal getBigDecimal(int tag, int hintPosition)
tag
- field taghintPosition
- The search will be started from this positionnull
if it is not found.ValueIsIncorrectException
- if the value can't be parsed to BigDecimal
public final ScaledDecimal getScaledDecimal(int tag, int hintPosition)
tag
- field taghintPosition
- The search will be started from this positionnull
if it is not found.ValueIsIncorrectException
- if the value can't be parsed to ScaledDecimal
public final LocalDateTime getUTCTimestamp(int tag, int hintPosition)
tag
- field taghintPosition
- The search will be started from this positionnull
if it is not found.ValueIsIncorrectException
- if the value can't be parsed to LocalDateTime
public final HighResolutionTimestamp getHighResolutionTimestamp(int tag, TimestampFormat format, int hintPosition)
tag
- field tagformat
- format to be used during parsinghintPosition
- The search will be started from this positionnull
if it is not found.ValueIsIncorrectException
- if the field value can't be parsed to HighResolutionTimestamp
with
specified TimestampFormat
formatpublic final String get(int tag, int hintPosition)
tag
- field taghintPosition
- The search will be started from this positionpublic final boolean get(int tag, ScaledDecimal value, int hintPosition)
ScaledDecimal
with value by the given tag.tag
- field tagvalue
- object to be filledhintPosition
- The search will be started from this positionValueIsIncorrectException
- if the value can't be parsed to ScaledDecimal
public final boolean get(int tag, HighResolutionTimestamp value, TimestampFormat format, int hintPosition)
HighResolutionTimestamp
with value by the given tag.tag
- field tagvalue
- object to be filledformat
- format to be used during parsinghintPosition
- The search will be started from this positionValueIsIncorrectException
- if the field value can't be parsed to HighResolutionTimestamp
with
specified TimestampFormat
formatpublic final boolean get(int tag, Field field, int hintPosition)
Field
with reference to value by the given tag.tag
- field tagfield
- field to be filledhintPosition
- The search will be started from this positionpublic final boolean get(int tag, ValuePtr valuePtr, int hintPosition)
ValuePtr
with reference to value by the given tag.tag
- field tagvaluePtr
- field value reference to be filledhintPosition
- The search will be started from this positionpublic final char getByIndexChar(int index)
Note:
Field index can be found using findIndex(int)
method.
index
- index of tag/value pairIndexNotFoundException
- if the index is invalid.ValueIsIncorrectException
- if the value is not a charpublic final int getByIndexInteger(int index)
Note:
Field index can be found using findIndex(int)
method.
index
- index of tag/value pairIndexNotFoundException
- if the index is invalid.ValueIsIncorrectException
- if the value can't be parsed to intpublic final long getByIndexLong(int index)
Note:
Field index can be found using findIndex(int)
method.
index
- index of tag/value pairIndexNotFoundException
- if the index is invalid.ValueIsIncorrectException
- if the value can't be parsed to longpublic final double getByIndexDouble(int index)
Note:
Field index can be found using findIndex(int)
method.
index
- index of tag/value pairIndexNotFoundException
- if the index is invalid.ValueIsIncorrectException
- if the value can't be parsed to doublepublic final BigDecimal getByIndexBigDecimal(int index)
Note:
Field index can be found using findIndex(int)
method.
index
- index of tag/value pairIndexNotFoundException
- if the index is invalid.ValueIsIncorrectException
- if the value can't be parsed to BigDecimal
public final ScaledDecimal getByIndexScaledDecimal(int index)
Note:
Field index can be found using findIndex(int)
method.
index
- index of tag/value pairIndexNotFoundException
- if the index is invalid.ValueIsIncorrectException
- if the value can't be parsed to ScaledDecimal
public final LocalDateTime getByIndexUTCTimestamp(int index)
Note:
Field index can be found using findIndex(int)
method.
index
- index of tag/value pairIndexNotFoundException
- if the index is invalid.ValueIsIncorrectException
- if the value can't be parsed to LocalDateTime
public final HighResolutionTimestamp getByIndexHighResolutionTimestamp(int index, TimestampFormat format)
Note:
Field index can be found using findIndex(int)
method.
index
- index of tag/value pairformat
- format to be used during parsingIndexNotFoundException
- if the index is invalid.ValueIsIncorrectException
- if the field value can't be parsed to HighResolutionTimestamp
with
specified TimestampFormat
formatpublic final String getByIndex(int index)
Note:
Field index can be found using findIndex(int)
method.
index
- index of tag/value pairIndexNotFoundException
- if the index is invalid.public final boolean getByIndex(int index, ScaledDecimal value)
ScaledDecimal
with value by the given tag.index
- index of tag/value pairvalue
- object to be filledValueIsIncorrectException
- if the value can't be parsed to ScaledDecimal
public final boolean getByIndex(int index, HighResolutionTimestamp value, TimestampFormat format)
HighResolutionTimestamp
with value by the given tag.index
- index of tag/value pairvalue
- object to be filledformat
- format to be used during parsingValueIsIncorrectException
- if the field value can't be parsed to HighResolutionTimestamp
with
specified TimestampFormat
formatpublic final boolean getByIndex(int index, Field field)
Note:
Field index can be found using findIndex(int)
method.
index
- index of tag/value pairfield
- field to be filledpublic final boolean getByIndex(int index, ValuePtr valuePtr)
ValuePtr
with reference to value from the given field index.
Note:
Field index can be found using findIndex(int)
method.
index
- index of tag/value pairvaluePtr
- field value reference to be filledpublic final int getTagByIndex(int index)
Note:
Field index can be found using findIndex(int)
method.
index
- index of tag/value pairIndexNotFoundException
- if the index is invalid.public final ArrayList<String> getValues(int tag)
tag
- fields tagpublic final void getValues(int tag, List<String> list)
tag
- field taglist
- list to be filledpublic boolean hasFlag(int tag)
tag
- field tagpublic boolean contains(int tag)
tag
- field tagpublic boolean containsSame(int tag, CharSequence expectedValue)
tag
- field tag numberexpectedValue
- expected valuetrue
in case exits, false
otherwisepublic boolean containsSame(int tag, byte[] expectedValue, int offset, int length)
tag
- field tag numberexpectedValue
- expected valueoffset
- expected value offsetlength
- expected value lengthtrue
in case exits, false
otherwisepublic boolean append(int tag, StringBuilder builder)
StringBuilder
.tag
- field tag numberbuilder
- string builder value of the field to be appendedtrue
if the value was appended, and false
otherwiseNullPointerException
- if (buffer == null)
public final int findIndex(int tag)
Note: If there are multiple tag/value pairs corresponding to the given tag it will return the first one only.
tag
- field tagpublic final int findIndex(int tag, int hintPosition)
Note: If there are multiple tag/value pairs corresponding to the given tag it will return the first one only.
tag
- field taghintPosition
- The search will be started from this position.public final int getNumberOfFields()
public boolean checkType(char expectedType)
expectedType
- expected message typepublic boolean checkType(CharSequence expectedType)
expectedType
- expected message typepublic final FlatMessage remove()
public boolean remove(int tag)
Note: After removing tag the found indexes will not be valid.
tag
- field tagpublic void removeByIndex(int index)
Note: After removing a field the found indexes will not be valid.
index
- index of tag/value pair to be removedIndexNotFoundException
- if the index is invalid.public final void toString(StringBuilder builder)
StringBuilder
with the string representation of the object.builder
- string builder to be filledpublic Stream<Field> stream()
Copyright © 2005–2024 Onix Solutions. All rights reserved.