All Downloads are FREE. Search and download functionalities are using the official Maven repository.

b3.entrypoint.fixp.sbe.ExecutionReport_ForwardEncoder Maven / Gradle / Ivy

/* Generated SBE (Simple Binary Encoding) message codec. */
package b3.entrypoint.fixp.sbe;

import org.agrona.MutableDirectBuffer;
import org.agrona.DirectBuffer;
import org.agrona.sbe.*;


/**
 * Execution Report – Forward message is sent with order fills were traded and processed on Matching Engine for Forward exclusively (Termo).
 */
@SuppressWarnings("all")
public final class ExecutionReport_ForwardEncoder implements MessageEncoderFlyweight
{
    public static final int BLOCK_LENGTH = 128;
    public static final int TEMPLATE_ID = 205;
    public static final int SCHEMA_ID = 1;
    public static final int SCHEMA_VERSION = 5;
    public static final java.nio.ByteOrder BYTE_ORDER = java.nio.ByteOrder.LITTLE_ENDIAN;

    private final ExecutionReport_ForwardEncoder parentMessage = this;
    private MutableDirectBuffer buffer;
    private int initialOffset;
    private int offset;
    private int limit;

    public int sbeBlockLength()
    {
        return BLOCK_LENGTH;
    }

    public int sbeTemplateId()
    {
        return TEMPLATE_ID;
    }

    public int sbeSchemaId()
    {
        return SCHEMA_ID;
    }

    public int sbeSchemaVersion()
    {
        return SCHEMA_VERSION;
    }

    public String sbeSemanticType()
    {
        return "";
    }

    public MutableDirectBuffer buffer()
    {
        return buffer;
    }

    public int initialOffset()
    {
        return initialOffset;
    }

    public int offset()
    {
        return offset;
    }

    public ExecutionReport_ForwardEncoder wrap(final MutableDirectBuffer buffer, final int offset)
    {
        if (buffer != this.buffer)
        {
            this.buffer = buffer;
        }
        this.initialOffset = offset;
        this.offset = offset;
        limit(offset + BLOCK_LENGTH);

        return this;
    }

    public ExecutionReport_ForwardEncoder wrapAndApplyHeader(
        final MutableDirectBuffer buffer, final int offset, final MessageHeaderEncoder headerEncoder)
    {
        headerEncoder
            .wrap(buffer, offset)
            .blockLength(BLOCK_LENGTH)
            .templateId(TEMPLATE_ID)
            .schemaId(SCHEMA_ID)
            .version(SCHEMA_VERSION);

        return wrap(buffer, offset + MessageHeaderEncoder.ENCODED_LENGTH);
    }

    public int encodedLength()
    {
        return limit - offset;
    }

    public int limit()
    {
        return limit;
    }

    public void limit(final int limit)
    {
        this.limit = limit;
    }

    public static int messageTypeId()
    {
        return 35;
    }

    public static int messageTypeSinceVersion()
    {
        return 0;
    }

    public static int messageTypeEncodingOffset()
    {
        return 0;
    }

    public static int messageTypeEncodingLength()
    {
        return 1;
    }

    public static String messageTypeMetaAttribute(final MetaAttribute metaAttribute)
    {
        if (MetaAttribute.PRESENCE == metaAttribute)
        {
            return "constant";
        }

        return "";
    }

    public static int execIDId()
    {
        return 17;
    }

    public static int execIDSinceVersion()
    {
        return 0;
    }

    public static int execIDEncodingOffset()
    {
        return 0;
    }

    public static int execIDEncodingLength()
    {
        return 8;
    }

    public static String execIDMetaAttribute(final MetaAttribute metaAttribute)
    {
        if (MetaAttribute.PRESENCE == metaAttribute)
        {
            return "required";
        }

        return "";
    }

    public static long execIDNullValue()
    {
        return 0xffffffffffffffffL;
    }

    public static long execIDMinValue()
    {
        return 0x0L;
    }

    public static long execIDMaxValue()
    {
        return 0xfffffffffffffffeL;
    }

    public ExecutionReport_ForwardEncoder execID(final long value)
    {
        buffer.putLong(offset + 0, value, java.nio.ByteOrder.LITTLE_ENDIAN);
        return this;
    }


    public static int orderIDId()
    {
        return 37;
    }

    public static int orderIDSinceVersion()
    {
        return 0;
    }

    public static int orderIDEncodingOffset()
    {
        return 8;
    }

    public static int orderIDEncodingLength()
    {
        return 8;
    }

    public static String orderIDMetaAttribute(final MetaAttribute metaAttribute)
    {
        if (MetaAttribute.PRESENCE == metaAttribute)
        {
            return "required";
        }

        return "";
    }

    public static long orderIDNullValue()
    {
        return 0xffffffffffffffffL;
    }

    public static long orderIDMinValue()
    {
        return 0x0L;
    }

    public static long orderIDMaxValue()
    {
        return 0xfffffffffffffffeL;
    }

    public ExecutionReport_ForwardEncoder orderID(final long value)
    {
        buffer.putLong(offset + 8, value, java.nio.ByteOrder.LITTLE_ENDIAN);
        return this;
    }


    public static int clOrdIDId()
    {
        return 11;
    }

    public static int clOrdIDSinceVersion()
    {
        return 0;
    }

    public static int clOrdIDEncodingOffset()
    {
        return 16;
    }

    public static int clOrdIDEncodingLength()
    {
        return 8;
    }

    public static String clOrdIDMetaAttribute(final MetaAttribute metaAttribute)
    {
        if (MetaAttribute.PRESENCE == metaAttribute)
        {
            return "optional";
        }

        return "";
    }

    public static long clOrdIDNullValue()
    {
        return 0x0L;
    }

    public static long clOrdIDMinValue()
    {
        return 0x0L;
    }

    public static long clOrdIDMaxValue()
    {
        return 0xfffffffffffffffeL;
    }

    public ExecutionReport_ForwardEncoder clOrdID(final long value)
    {
        buffer.putLong(offset + 16, value, java.nio.ByteOrder.LITTLE_ENDIAN);
        return this;
    }


    public static int securityIDId()
    {
        return 48;
    }

    public static int securityIDSinceVersion()
    {
        return 0;
    }

    public static int securityIDEncodingOffset()
    {
        return 24;
    }

    public static int securityIDEncodingLength()
    {
        return 8;
    }

    public static String securityIDMetaAttribute(final MetaAttribute metaAttribute)
    {
        if (MetaAttribute.PRESENCE == metaAttribute)
        {
            return "required";
        }

        return "";
    }

    public static long securityIDNullValue()
    {
        return 0xffffffffffffffffL;
    }

    public static long securityIDMinValue()
    {
        return 0x0L;
    }

    public static long securityIDMaxValue()
    {
        return 0xfffffffffffffffeL;
    }

    public ExecutionReport_ForwardEncoder securityID(final long value)
    {
        buffer.putLong(offset + 24, value, java.nio.ByteOrder.LITTLE_ENDIAN);
        return this;
    }


    public static int securityIDSourceId()
    {
        return 22;
    }

    public static int securityIDSourceSinceVersion()
    {
        return 0;
    }

    public static int securityIDSourceEncodingOffset()
    {
        return 32;
    }

    public static int securityIDSourceEncodingLength()
    {
        return 0;
    }

    public static String securityIDSourceMetaAttribute(final MetaAttribute metaAttribute)
    {
        if (MetaAttribute.PRESENCE == metaAttribute)
        {
            return "constant";
        }

        return "";
    }

    public static byte securityIDSourceNullValue()
    {
        return (byte)0;
    }

    public static byte securityIDSourceMinValue()
    {
        return (byte)32;
    }

    public static byte securityIDSourceMaxValue()
    {
        return (byte)126;
    }


    private static final byte[] SECURITYIDSOURCE_VALUE = { 56 };

    public static int securityIDSourceLength()
    {
        return 1;
    }


    public byte securityIDSource(final int index)
    {
        return SECURITYIDSOURCE_VALUE[index];
    }

    public int getSecurityIDSource(final byte[] dst, final int offset, final int length)
    {
        final int bytesCopied = Math.min(length, 1);
        System.arraycopy(SECURITYIDSOURCE_VALUE, 0, dst, offset, bytesCopied);

        return bytesCopied;
    }

    public byte securityIDSource()
    {
        return (byte)56;
    }


    public static int securityExchangeId()
    {
        return 207;
    }

    public static int securityExchangeSinceVersion()
    {
        return 0;
    }

    public static int securityExchangeEncodingOffset()
    {
        return 32;
    }

    public static int securityExchangeEncodingLength()
    {
        return 0;
    }

    public static String securityExchangeMetaAttribute(final MetaAttribute metaAttribute)
    {
        if (MetaAttribute.PRESENCE == metaAttribute)
        {
            return "constant";
        }

        return "";
    }

    public static byte securityExchangeNullValue()
    {
        return (byte)0;
    }

    public static byte securityExchangeMinValue()
    {
        return (byte)32;
    }

    public static byte securityExchangeMaxValue()
    {
        return (byte)126;
    }


    private static final byte[] SECURITYEXCHANGE_VALUE = { 66, 86, 77, 70 };

    public static int securityExchangeLength()
    {
        return 4;
    }


    public byte securityExchange(final int index)
    {
        return SECURITYEXCHANGE_VALUE[index];
    }

    public int getSecurityExchange(final byte[] dst, final int offset, final int length)
    {
        final int bytesCopied = Math.min(length, 4);
        System.arraycopy(SECURITYEXCHANGE_VALUE, 0, dst, offset, bytesCopied);

        return bytesCopied;
    }

    public String securityExchange()
    {
        return "BVMF";
    }


    public static int secondaryOrderIDId()
    {
        return 198;
    }

    public static int secondaryOrderIDSinceVersion()
    {
        return 0;
    }

    public static int secondaryOrderIDEncodingOffset()
    {
        return 32;
    }

    public static int secondaryOrderIDEncodingLength()
    {
        return 8;
    }

    public static String secondaryOrderIDMetaAttribute(final MetaAttribute metaAttribute)
    {
        if (MetaAttribute.PRESENCE == metaAttribute)
        {
            return "optional";
        }

        return "";
    }

    public static long secondaryOrderIDNullValue()
    {
        return 0x0L;
    }

    public static long secondaryOrderIDMinValue()
    {
        return 0x0L;
    }

    public static long secondaryOrderIDMaxValue()
    {
        return 0xfffffffffffffffeL;
    }

    public ExecutionReport_ForwardEncoder secondaryOrderID(final long value)
    {
        buffer.putLong(offset + 32, value, java.nio.ByteOrder.LITTLE_ENDIAN);
        return this;
    }


    public static int lastQtyId()
    {
        return 32;
    }

    public static int lastQtySinceVersion()
    {
        return 0;
    }

    public static int lastQtyEncodingOffset()
    {
        return 40;
    }

    public static int lastQtyEncodingLength()
    {
        return 8;
    }

    public static String lastQtyMetaAttribute(final MetaAttribute metaAttribute)
    {
        if (MetaAttribute.PRESENCE == metaAttribute)
        {
            return "required";
        }

        return "";
    }

    public static long lastQtyNullValue()
    {
        return 0xffffffffffffffffL;
    }

    public static long lastQtyMinValue()
    {
        return 0x0L;
    }

    public static long lastQtyMaxValue()
    {
        return 0xfffffffffffffffeL;
    }

    public ExecutionReport_ForwardEncoder lastQty(final long value)
    {
        buffer.putLong(offset + 40, value, java.nio.ByteOrder.LITTLE_ENDIAN);
        return this;
    }


    public static int lastPxId()
    {
        return 31;
    }

    public static int lastPxSinceVersion()
    {
        return 0;
    }

    public static int lastPxEncodingOffset()
    {
        return 48;
    }

    public static int lastPxEncodingLength()
    {
        return 8;
    }

    public static String lastPxMetaAttribute(final MetaAttribute metaAttribute)
    {
        if (MetaAttribute.PRESENCE == metaAttribute)
        {
            return "required";
        }

        return "";
    }

    private final PriceEncoder lastPx = new PriceEncoder();

    /**
     * Price of last fill.
     *
     * @return PriceEncoder : Price of last fill.
     */
    public PriceEncoder lastPx()
    {
        lastPx.wrap(buffer, offset + 48);
        return lastPx;
    }

    public static int leavesQtyId()
    {
        return 151;
    }

    public static int leavesQtySinceVersion()
    {
        return 0;
    }

    public static int leavesQtyEncodingOffset()
    {
        return 56;
    }

    public static int leavesQtyEncodingLength()
    {
        return 8;
    }

    public static String leavesQtyMetaAttribute(final MetaAttribute metaAttribute)
    {
        if (MetaAttribute.PRESENCE == metaAttribute)
        {
            return "required";
        }

        return "";
    }

    public static long leavesQtyNullValue()
    {
        return 0xffffffffffffffffL;
    }

    public static long leavesQtyMinValue()
    {
        return 0x0L;
    }

    public static long leavesQtyMaxValue()
    {
        return 0xfffffffffffffffeL;
    }

    public ExecutionReport_ForwardEncoder leavesQty(final long value)
    {
        buffer.putLong(offset + 56, value, java.nio.ByteOrder.LITTLE_ENDIAN);
        return this;
    }


    public static int cumQtyId()
    {
        return 14;
    }

    public static int cumQtySinceVersion()
    {
        return 0;
    }

    public static int cumQtyEncodingOffset()
    {
        return 64;
    }

    public static int cumQtyEncodingLength()
    {
        return 8;
    }

    public static String cumQtyMetaAttribute(final MetaAttribute metaAttribute)
    {
        if (MetaAttribute.PRESENCE == metaAttribute)
        {
            return "required";
        }

        return "";
    }

    public static long cumQtyNullValue()
    {
        return 0xffffffffffffffffL;
    }

    public static long cumQtyMinValue()
    {
        return 0x0L;
    }

    public static long cumQtyMaxValue()
    {
        return 0xfffffffffffffffeL;
    }

    public ExecutionReport_ForwardEncoder cumQty(final long value)
    {
        buffer.putLong(offset + 64, value, java.nio.ByteOrder.LITTLE_ENDIAN);
        return this;
    }


    public static int uniqueTradeIDId()
    {
        return 6032;
    }

    public static int uniqueTradeIDSinceVersion()
    {
        return 0;
    }

    public static int uniqueTradeIDEncodingOffset()
    {
        return 72;
    }

    public static int uniqueTradeIDEncodingLength()
    {
        return 4;
    }

    public static String uniqueTradeIDMetaAttribute(final MetaAttribute metaAttribute)
    {
        if (MetaAttribute.PRESENCE == metaAttribute)
        {
            return "optional";
        }

        return "";
    }

    public static long uniqueTradeIDNullValue()
    {
        return 0L;
    }

    public static long uniqueTradeIDMinValue()
    {
        return 0L;
    }

    public static long uniqueTradeIDMaxValue()
    {
        return 4294967294L;
    }

    public ExecutionReport_ForwardEncoder uniqueTradeID(final long value)
    {
        buffer.putInt(offset + 72, (int)value, java.nio.ByteOrder.LITTLE_ENDIAN);
        return this;
    }


    public static int contraBrokerId()
    {
        return 375;
    }

    public static int contraBrokerSinceVersion()
    {
        return 0;
    }

    public static int contraBrokerEncodingOffset()
    {
        return 76;
    }

    public static int contraBrokerEncodingLength()
    {
        return 4;
    }

    public static String contraBrokerMetaAttribute(final MetaAttribute metaAttribute)
    {
        if (MetaAttribute.PRESENCE == metaAttribute)
        {
            return "required";
        }

        return "";
    }

    public static long contraBrokerNullValue()
    {
        return 4294967295L;
    }

    public static long contraBrokerMinValue()
    {
        return 0L;
    }

    public static long contraBrokerMaxValue()
    {
        return 4294967294L;
    }

    public ExecutionReport_ForwardEncoder contraBroker(final long value)
    {
        buffer.putInt(offset + 76, (int)value, java.nio.ByteOrder.LITTLE_ENDIAN);
        return this;
    }


    public static int transactTimeId()
    {
        return 60;
    }

    public static int transactTimeSinceVersion()
    {
        return 0;
    }

    public static int transactTimeEncodingOffset()
    {
        return 80;
    }

    public static int transactTimeEncodingLength()
    {
        return 8;
    }

    public static String transactTimeMetaAttribute(final MetaAttribute metaAttribute)
    {
        if (MetaAttribute.PRESENCE == metaAttribute)
        {
            return "required";
        }

        return "";
    }

    private final UTCTimestampNanosEncoder transactTime = new UTCTimestampNanosEncoder();

    /**
     * Time of execution/order creation; expressed in UTC.
     *
     * @return UTCTimestampNanosEncoder : Time of execution/order creation; expressed in UTC.
     */
    public UTCTimestampNanosEncoder transactTime()
    {
        transactTime.wrap(buffer, offset + 80);
        return transactTime;
    }

    public static int tradeDateId()
    {
        return 75;
    }

    public static int tradeDateSinceVersion()
    {
        return 0;
    }

    public static int tradeDateEncodingOffset()
    {
        return 88;
    }

    public static int tradeDateEncodingLength()
    {
        return 2;
    }

    public static String tradeDateMetaAttribute(final MetaAttribute metaAttribute)
    {
        if (MetaAttribute.PRESENCE == metaAttribute)
        {
            return "optional";
        }

        return "";
    }

    public static int tradeDateNullValue()
    {
        return 0;
    }

    public static int tradeDateMinValue()
    {
        return 0;
    }

    public static int tradeDateMaxValue()
    {
        return 65534;
    }

    public ExecutionReport_ForwardEncoder tradeDate(final int value)
    {
        buffer.putShort(offset + 88, (short)value, java.nio.ByteOrder.LITTLE_ENDIAN);
        return this;
    }


    public static int execRefIDId()
    {
        return 19;
    }

    public static int execRefIDSinceVersion()
    {
        return 0;
    }

    public static int execRefIDEncodingOffset()
    {
        return 90;
    }

    public static int execRefIDEncodingLength()
    {
        return 8;
    }

    public static String execRefIDMetaAttribute(final MetaAttribute metaAttribute)
    {
        if (MetaAttribute.PRESENCE == metaAttribute)
        {
            return "optional";
        }

        return "";
    }

    public static long execRefIDNullValue()
    {
        return 0x0L;
    }

    public static long execRefIDMinValue()
    {
        return 0x0L;
    }

    public static long execRefIDMaxValue()
    {
        return 0xfffffffffffffffeL;
    }

    public ExecutionReport_ForwardEncoder execRefID(final long value)
    {
        buffer.putLong(offset + 90, value, java.nio.ByteOrder.LITTLE_ENDIAN);
        return this;
    }


    public static int secondaryExecIDId()
    {
        return 527;
    }

    public static int secondaryExecIDSinceVersion()
    {
        return 0;
    }

    public static int secondaryExecIDEncodingOffset()
    {
        return 98;
    }

    public static int secondaryExecIDEncodingLength()
    {
        return 8;
    }

    public static String secondaryExecIDMetaAttribute(final MetaAttribute metaAttribute)
    {
        if (MetaAttribute.PRESENCE == metaAttribute)
        {
            return "optional";
        }

        return "";
    }

    public static long secondaryExecIDNullValue()
    {
        return 0x0L;
    }

    public static long secondaryExecIDMinValue()
    {
        return 0x0L;
    }

    public static long secondaryExecIDMaxValue()
    {
        return 0xfffffffffffffffeL;
    }

    public ExecutionReport_ForwardEncoder secondaryExecID(final long value)
    {
        buffer.putLong(offset + 98, value, java.nio.ByteOrder.LITTLE_ENDIAN);
        return this;
    }


    public static int crossIDId()
    {
        return 548;
    }

    public static int crossIDSinceVersion()
    {
        return 0;
    }

    public static int crossIDEncodingOffset()
    {
        return 106;
    }

    public static int crossIDEncodingLength()
    {
        return 8;
    }

    public static String crossIDMetaAttribute(final MetaAttribute metaAttribute)
    {
        if (MetaAttribute.PRESENCE == metaAttribute)
        {
            return "required";
        }

        return "";
    }

    public static long crossIDNullValue()
    {
        return 0xffffffffffffffffL;
    }

    public static long crossIDMinValue()
    {
        return 0x0L;
    }

    public static long crossIDMaxValue()
    {
        return 0xfffffffffffffffeL;
    }

    public ExecutionReport_ForwardEncoder crossID(final long value)
    {
        buffer.putLong(offset + 106, value, java.nio.ByteOrder.LITTLE_ENDIAN);
        return this;
    }


    public static int aggressorIndicatorId()
    {
        return 1057;
    }

    public static int aggressorIndicatorSinceVersion()
    {
        return 0;
    }

    public static int aggressorIndicatorEncodingOffset()
    {
        return 114;
    }

    public static int aggressorIndicatorEncodingLength()
    {
        return 1;
    }

    public static String aggressorIndicatorMetaAttribute(final MetaAttribute metaAttribute)
    {
        if (MetaAttribute.PRESENCE == metaAttribute)
        {
            return "optional";
        }

        return "";
    }

    public ExecutionReport_ForwardEncoder aggressorIndicator(final Boolean value)
    {
        buffer.putByte(offset + 114, (byte)value.value());
        return this;
    }

    public static int ordStatusId()
    {
        return 39;
    }

    public static int ordStatusSinceVersion()
    {
        return 0;
    }

    public static int ordStatusEncodingOffset()
    {
        return 115;
    }

    public static int ordStatusEncodingLength()
    {
        return 1;
    }

    public static String ordStatusMetaAttribute(final MetaAttribute metaAttribute)
    {
        if (MetaAttribute.PRESENCE == metaAttribute)
        {
            return "required";
        }

        return "";
    }

    public ExecutionReport_ForwardEncoder ordStatus(final OrdStatus value)
    {
        buffer.putByte(offset + 115, value.value());
        return this;
    }

    public static int settlTypeId()
    {
        return 63;
    }

    public static int settlTypeSinceVersion()
    {
        return 0;
    }

    public static int settlTypeEncodingOffset()
    {
        return 116;
    }

    public static int settlTypeEncodingLength()
    {
        return 1;
    }

    public static String settlTypeMetaAttribute(final MetaAttribute metaAttribute)
    {
        if (MetaAttribute.PRESENCE == metaAttribute)
        {
            return "optional";
        }

        return "";
    }

    public ExecutionReport_ForwardEncoder settlType(final SettlType value)
    {
        buffer.putByte(offset + 116, value.value());
        return this;
    }

    public static int possResendId()
    {
        return 97;
    }

    public static int possResendSinceVersion()
    {
        return 0;
    }

    public static int possResendEncodingOffset()
    {
        return 117;
    }

    public static int possResendEncodingLength()
    {
        return 1;
    }

    public static String possResendMetaAttribute(final MetaAttribute metaAttribute)
    {
        if (MetaAttribute.PRESENCE == metaAttribute)
        {
            return "required";
        }

        return "";
    }

    public ExecutionReport_ForwardEncoder possResend(final Boolean value)
    {
        buffer.putByte(offset + 117, (byte)value.value());
        return this;
    }

    public static int daysToSettlementId()
    {
        return 5497;
    }

    public static int daysToSettlementSinceVersion()
    {
        return 0;
    }

    public static int daysToSettlementEncodingOffset()
    {
        return 118;
    }

    public static int daysToSettlementEncodingLength()
    {
        return 2;
    }

    public static String daysToSettlementMetaAttribute(final MetaAttribute metaAttribute)
    {
        if (MetaAttribute.PRESENCE == metaAttribute)
        {
            return "optional";
        }

        return "";
    }

    public static int daysToSettlementNullValue()
    {
        return 65535;
    }

    public static int daysToSettlementMinValue()
    {
        return 0;
    }

    public static int daysToSettlementMaxValue()
    {
        return 65534;
    }

    public ExecutionReport_ForwardEncoder daysToSettlement(final int value)
    {
        buffer.putShort(offset + 118, (short)value, java.nio.ByteOrder.LITTLE_ENDIAN);
        return this;
    }


    public static int fixedRateId()
    {
        return 5706;
    }

    public static int fixedRateSinceVersion()
    {
        return 0;
    }

    public static int fixedRateEncodingOffset()
    {
        return 120;
    }

    public static int fixedRateEncodingLength()
    {
        return 8;
    }

    public static String fixedRateMetaAttribute(final MetaAttribute metaAttribute)
    {
        if (MetaAttribute.PRESENCE == metaAttribute)
        {
            return "required";
        }

        return "";
    }

    private final PercentageEncoder fixedRate = new PercentageEncoder();

    /**
     * Describes the interest to be paid by the forward buyer and received by the forward seller, in proportion to the agreed days to settlement. Expressed in decimal form. For example, 1% is expressed and sent as 0.01. One basis point is represented as 0.0001.
     *
     * @return PercentageEncoder : Describes the interest to be paid by the forward buyer and received by the forward seller, in proportion to the agreed days to settlement. Expressed in decimal form. For example, 1% is expressed and sent as 0.01. One basis point is represented as 0.0001.
     */
    public PercentageEncoder fixedRate()
    {
        fixedRate.wrap(buffer, offset + 120);
        return fixedRate;
    }

    public static int deskIDId()
    {
        return 35510;
    }

    public static String deskIDCharacterEncoding()
    {
        return java.nio.charset.StandardCharsets.US_ASCII.name();
    }

    public static String deskIDMetaAttribute(final MetaAttribute metaAttribute)
    {
        if (MetaAttribute.PRESENCE == metaAttribute)
        {
            return "required";
        }
        if (MetaAttribute.SEMANTIC_TYPE == metaAttribute)
        {
            return "String";
        }

        return "";
    }

    public static int deskIDHeaderLength()
    {
        return 1;
    }

    public ExecutionReport_ForwardEncoder putDeskID(final DirectBuffer src, final int srcOffset, final int length)
    {
        if (length > 20)
        {
            throw new IllegalStateException("length > maxValue for type: " + length);
        }

        final int headerLength = 1;
        final int limit = parentMessage.limit();
        parentMessage.limit(limit + headerLength + length);
        buffer.putByte(limit, (byte)length);
        buffer.putBytes(limit + headerLength, src, srcOffset, length);

        return this;
    }

    public ExecutionReport_ForwardEncoder putDeskID(final byte[] src, final int srcOffset, final int length)
    {
        if (length > 20)
        {
            throw new IllegalStateException("length > maxValue for type: " + length);
        }

        final int headerLength = 1;
        final int limit = parentMessage.limit();
        parentMessage.limit(limit + headerLength + length);
        buffer.putByte(limit, (byte)length);
        buffer.putBytes(limit + headerLength, src, srcOffset, length);

        return this;
    }

    public ExecutionReport_ForwardEncoder deskID(final String value)
    {
        final int length = null == value ? 0 : value.length();
        if (length > 20)
        {
            throw new IllegalStateException("length > maxValue for type: " + length);
        }

        final int headerLength = 1;
        final int limit = parentMessage.limit();
        parentMessage.limit(limit + headerLength + length);
        buffer.putByte(limit, (byte)length);
        buffer.putStringWithoutLengthAscii(limit + headerLength, value);

        return this;
    }

    public ExecutionReport_ForwardEncoder deskID(final CharSequence value)
    {
        final int length = null == value ? 0 : value.length();
        if (length > 20)
        {
            throw new IllegalStateException("length > maxValue for type: " + length);
        }

        final int headerLength = 1;
        final int limit = parentMessage.limit();
        parentMessage.limit(limit + headerLength + length);
        buffer.putByte(limit, (byte)length);
        buffer.putStringWithoutLengthAscii(limit + headerLength, value);

        return this;
    }

    public static int memoId()
    {
        return 5149;
    }

    public static String memoCharacterEncoding()
    {
        return java.nio.charset.StandardCharsets.UTF_8.name();
    }

    public static String memoMetaAttribute(final MetaAttribute metaAttribute)
    {
        if (MetaAttribute.PRESENCE == metaAttribute)
        {
            return "required";
        }
        if (MetaAttribute.SEMANTIC_TYPE == metaAttribute)
        {
            return "String";
        }

        return "";
    }

    public static int memoHeaderLength()
    {
        return 1;
    }

    public ExecutionReport_ForwardEncoder putMemo(final DirectBuffer src, final int srcOffset, final int length)
    {
        if (length > 40)
        {
            throw new IllegalStateException("length > maxValue for type: " + length);
        }

        final int headerLength = 1;
        final int limit = parentMessage.limit();
        parentMessage.limit(limit + headerLength + length);
        buffer.putByte(limit, (byte)length);
        buffer.putBytes(limit + headerLength, src, srcOffset, length);

        return this;
    }

    public ExecutionReport_ForwardEncoder putMemo(final byte[] src, final int srcOffset, final int length)
    {
        if (length > 40)
        {
            throw new IllegalStateException("length > maxValue for type: " + length);
        }

        final int headerLength = 1;
        final int limit = parentMessage.limit();
        parentMessage.limit(limit + headerLength + length);
        buffer.putByte(limit, (byte)length);
        buffer.putBytes(limit + headerLength, src, srcOffset, length);

        return this;
    }

    public ExecutionReport_ForwardEncoder memo(final String value)
    {
        final byte[] bytes = (null == value || value.isEmpty()) ? org.agrona.collections.ArrayUtil.EMPTY_BYTE_ARRAY : value.getBytes(java.nio.charset.StandardCharsets.UTF_8);

        final int length = bytes.length;
        if (length > 40)
        {
            throw new IllegalStateException("length > maxValue for type: " + length);
        }

        final int headerLength = 1;
        final int limit = parentMessage.limit();
        parentMessage.limit(limit + headerLength + length);
        buffer.putByte(limit, (byte)length);
        buffer.putBytes(limit + headerLength, bytes, 0, length);

        return this;
    }

    public String toString()
    {
        if (null == buffer)
        {
            return "";
        }

        return appendTo(new StringBuilder()).toString();
    }

    public StringBuilder appendTo(final StringBuilder builder)
    {
        if (null == buffer)
        {
            return builder;
        }

        final ExecutionReport_ForwardDecoder decoder = new ExecutionReport_ForwardDecoder();
        decoder.wrap(buffer, initialOffset, BLOCK_LENGTH, SCHEMA_VERSION);

        return decoder.appendTo(builder);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy