Class BaseFieldSet
java.lang.Object
com.caplin.motif.fx.trading.orders.details.BaseFieldSet
- Direct Known Subclasses:
OrderFieldSet
,OrderSalesFieldSet
,StrategyFieldSet
Deprecated.
Parent class of OrderFieldSet
and StrategyFieldSet
.
This class provides the general purpose setField(String, Object)
and
setFields(Map)
methods, which you can use to set the value of a field by
name rather than using one of the domain-specific setter methods on the child classes.
-
Method Summary
-
Method Details
-
setField
Deprecated.Sets the value of a field by name. It's usually better to use one of the domain-specific setter methods onOrderFieldSet
orStrategyFieldSet
, but you can call this method if you want to include your own custom fields on anOrder
orStrategy
.- Parameters:
key
- The name of the field to set the value for.value
- The field value. This will be converted to a String usingObject.toString()
unless it is a BigDecimal, in which case it will be converted usingBigDecimal.toPlainString()
- Returns:
- A reference to this instance, to allow method chaining.
- Throws:
IllegalArgumentException
- If:- The key or value is null.
- The field name is reserved, such as OrderCount.
- The corresponding key already exists in the "partner map" for the field set. For example,
if you set the value of a editable field by calling
OrderBuilder.getEditableFields()
then an exception will be thrown if you try to set the same field name on the field set returned by callingOrderBuilder.getFixedFields()
.
-
toString
Deprecated. -
setFields
Deprecated.Sets the value of a number of fields by name. Calling this method is equivalent to callingsetField(String, Object)
multiple times.- Parameters:
fields
- A map of field names and values.- Returns:
- A reference to this instance, to allow method chaining.
-