public class FieldDataBuilder extends Object
FieldData
.
The fieldName
must always
be defined. Also one of the withValue...()
methods must be called
to define the field's type and content.
Example 1: A field of type STRING
with non-null content.
FieldDataBuilder.builder() .withFieldName("DSPLY_NAME") // Must always set this .withValueString("abcdefghijklmnop") .withFieldLength(16) .build()
Example 2: A field of type DECIMAL
with non-null content.
FieldDataBuilder.builder() .withFieldName("BID") // Must always set this .withValueDecimalStr("22.4") .build()
Example 3: A field of type DECIMAL
with null content.
FieldDataBuilder.builder() .withFieldName("ASK") // Must always set this .withValueDecimal(null) .build()
Modifier and Type | Method and Description |
---|---|
com.addicticks.avenuemq.dto.FieldData |
build() |
static FieldDataBuilder |
builder()
Creates a new builder.
|
FieldDataBuilder |
withFieldId(Integer fieldId)
Sets the field's Id.
|
FieldDataBuilder |
withFieldLength(Integer fieldLength)
Sets the field's maximum allowed bytes length.
|
FieldDataBuilder |
withFieldName(String fieldName)
Sets the Field Name.
|
FieldDataBuilder |
withValueBinary(byte[] valueBinary)
Sets a field of type
BINARY . |
FieldDataBuilder |
withValueBool(Boolean valueBoolean)
Sets a field of type
BOOLEAN . |
FieldDataBuilder |
withValueDate(OffsetDateTime valueDate)
Sets a field of type
DATE . |
FieldDataBuilder |
withValueDateTime(OffsetDateTime valueDateTime)
Sets a field of type
DATETIME . |
FieldDataBuilder |
withValueDecimal(BigDecimal valueDecimal)
Sets a field of type
DECIMAL . |
FieldDataBuilder |
withValueDecimalStr(String valueDecimalStr)
Sets a field of type
DECIMAL . |
FieldDataBuilder |
withValueInt(Integer valueInt)
Sets a field of type
STRING . |
FieldDataBuilder |
withValueLong(Long valueLong)
Sets a field of type
LONG . |
FieldDataBuilder |
withValueString(String valueString)
Sets a field of type
STRING . |
FieldDataBuilder |
withValueTime(OffsetTime valueTime)
Sets a field of type
TIME . |
public static FieldDataBuilder builder()
public FieldDataBuilder withFieldName(String fieldName)
public FieldDataBuilder withFieldId(Integer fieldId)
public FieldDataBuilder withFieldLength(Integer fieldLength)
STRING
and BINARY
. It serves no other purpose than to convey
to the consumer what to expect for future updates to this particular
field. This will allow the consumer to set aside sufficient
memory for this field.public FieldDataBuilder withValueString(String valueString)
STRING
.valueString
- the field's value (null
is an acceptable value)public FieldDataBuilder withValueInt(Integer valueInt)
STRING
.valueInt
- the field's value (null
is an acceptable value)public FieldDataBuilder withValueLong(Long valueLong)
LONG
.valueLong
- the field's value (null
is an acceptable value)public FieldDataBuilder withValueBool(Boolean valueBoolean)
BOOLEAN
.valueBoolean
- the field's value (null
is an acceptable value)public FieldDataBuilder withValueDecimal(BigDecimal valueDecimal)
DECIMAL
.valueDecimal
- the field's value (null
is an acceptable value)withValueDecimalStr(java.lang.String)
public FieldDataBuilder withValueDecimalStr(String valueDecimalStr)
DECIMAL
. This
is a convenience method which converts the supplied string into
a BigDecimal
.valueDecimalStr
- the field's value (null
is an acceptable value)withValueDecimal(java.math.BigDecimal)
public FieldDataBuilder withValueBinary(byte[] valueBinary)
BINARY
.valueBinary
- the field's value (null
is an acceptable value)public FieldDataBuilder withValueDate(OffsetDateTime valueDate)
DATE
.valueDate
- the field's value (null
is an acceptable value)public FieldDataBuilder withValueDateTime(OffsetDateTime valueDateTime)
DATETIME
.valueDateTime
- the field's value (null
is an acceptable value)public FieldDataBuilder withValueTime(OffsetTime valueTime)
TIME
.valueTime
- the field's value (null
is an acceptable value)public com.addicticks.avenuemq.dto.FieldData build()
Copyright © 2019 Addicticks. All rights reserved.