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

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

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

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


/**
 * Sent by client system to replace an existing order.
 */
@SuppressWarnings("all")
public final class OrderCancelReplaceRequestDecoder implements MessageDecoderFlyweight
{
    public static final int BLOCK_LENGTH = 119;
    public static final int TEMPLATE_ID = 104;
    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 OrderCancelReplaceRequestDecoder parentMessage = this;
    private DirectBuffer buffer;
    private int initialOffset;
    private int offset;
    private int limit;
    int actingBlockLength;
    int actingVersion;

    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 DirectBuffer buffer()
    {
        return buffer;
    }

    public int initialOffset()
    {
        return initialOffset;
    }

    public int offset()
    {
        return offset;
    }

    public OrderCancelReplaceRequestDecoder wrap(
        final DirectBuffer buffer,
        final int offset,
        final int actingBlockLength,
        final int actingVersion)
    {
        if (buffer != this.buffer)
        {
            this.buffer = buffer;
        }
        this.initialOffset = offset;
        this.offset = offset;
        this.actingBlockLength = actingBlockLength;
        this.actingVersion = actingVersion;
        limit(offset + actingBlockLength);

        return this;
    }

    public OrderCancelReplaceRequestDecoder wrapAndApplyHeader(
        final DirectBuffer buffer,
        final int offset,
        final MessageHeaderDecoder headerDecoder)
    {
        headerDecoder.wrap(buffer, offset);

        final int templateId = headerDecoder.templateId();
        if (TEMPLATE_ID != templateId)
        {
            throw new IllegalStateException("Invalid TEMPLATE_ID: " + templateId);
        }

        return wrap(
            buffer,
            offset + MessageHeaderDecoder.ENCODED_LENGTH,
            headerDecoder.blockLength(),
            headerDecoder.version());
    }

    public OrderCancelReplaceRequestDecoder sbeRewind()
    {
        return wrap(buffer, initialOffset, actingBlockLength, actingVersion);
    }

    public int sbeDecodedLength()
    {
        final int currentLimit = limit();
        sbeSkip();
        final int decodedLength = encodedLength();
        limit(currentLimit);

        return decodedLength;
    }

    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 short messageTypeRaw()
    {
        return MessageType.OrderCancelReplaceRequest.value();
    }


    public MessageType messageType()
    {
        return MessageType.OrderCancelReplaceRequest;
    }


    public static int origClOrdIDId()
    {
        return 41;
    }

    public static int origClOrdIDSinceVersion()
    {
        return 0;
    }

    public static int origClOrdIDEncodingOffset()
    {
        return 0;
    }

    public static int origClOrdIDEncodingLength()
    {
        return 8;
    }

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

        return "";
    }

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

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

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

    public long origClOrdID()
    {
        return buffer.getLong(offset + 0, java.nio.ByteOrder.LITTLE_ENDIAN);
    }


    public static int clOrdIDId()
    {
        return 11;
    }

    public static int clOrdIDSinceVersion()
    {
        return 0;
    }

    public static int clOrdIDEncodingOffset()
    {
        return 8;
    }

    public static int clOrdIDEncodingLength()
    {
        return 8;
    }

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

        return "";
    }

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

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

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

    public long clOrdID()
    {
        return buffer.getLong(offset + 8, java.nio.ByteOrder.LITTLE_ENDIAN);
    }


    public static int securityIDId()
    {
        return 48;
    }

    public static int securityIDSinceVersion()
    {
        return 0;
    }

    public static int securityIDEncodingOffset()
    {
        return 16;
    }

    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 long securityID()
    {
        return buffer.getLong(offset + 16, java.nio.ByteOrder.LITTLE_ENDIAN);
    }


    public static int securityIDSourceId()
    {
        return 22;
    }

    public static int securityIDSourceSinceVersion()
    {
        return 0;
    }

    public static int securityIDSourceEncodingOffset()
    {
        return 24;
    }

    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 24;
    }

    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 priceId()
    {
        return 44;
    }

    public static int priceSinceVersion()
    {
        return 0;
    }

    public static int priceEncodingOffset()
    {
        return 24;
    }

    public static int priceEncodingLength()
    {
        return 8;
    }

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

        return "";
    }

    private final PriceOptionalDecoder price = new PriceOptionalDecoder();

    /**
     * Price per share or contract. Conditionally required if the order type requires a price (not market orders and RLP).
     *
     * @return PriceOptionalDecoder : Price per share or contract. Conditionally required if the order type requires a price (not market orders and RLP).
     */
    public PriceOptionalDecoder price()
    {
        price.wrap(buffer, offset + 24);
        return price;
    }

    public static int orderQtyId()
    {
        return 38;
    }

    public static int orderQtySinceVersion()
    {
        return 0;
    }

    public static int orderQtyEncodingOffset()
    {
        return 32;
    }

    public static int orderQtyEncodingLength()
    {
        return 8;
    }

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

        return "";
    }

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

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

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

    public long orderQty()
    {
        return buffer.getLong(offset + 32, java.nio.ByteOrder.LITTLE_ENDIAN);
    }


    public static int accountId()
    {
        return 1;
    }

    public static int accountSinceVersion()
    {
        return 0;
    }

    public static int accountEncodingOffset()
    {
        return 40;
    }

    public static int accountEncodingLength()
    {
        return 4;
    }

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

        return "";
    }

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

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

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

    public long account()
    {
        return (buffer.getInt(offset + 40, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF_FFFFL);
    }


    public static int accountTypeId()
    {
        return 581;
    }

    public static int accountTypeSinceVersion()
    {
        return 0;
    }

    public static int accountTypeEncodingOffset()
    {
        return 44;
    }

    public static int accountTypeEncodingLength()
    {
        return 1;
    }

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

        return "";
    }

    public short accountTypeRaw()
    {
        return ((short)(buffer.getByte(offset + 44) & 0xFF));
    }

    public AccountType accountType()
    {
        return AccountType.get(((short)(buffer.getByte(offset + 44) & 0xFF)));
    }


    public static int marketSegmentIDId()
    {
        return 1300;
    }

    public static int marketSegmentIDSinceVersion()
    {
        return 0;
    }

    public static int marketSegmentIDEncodingOffset()
    {
        return 45;
    }

    public static int marketSegmentIDEncodingLength()
    {
        return 1;
    }

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

        return "";
    }

    public static short marketSegmentIDNullValue()
    {
        return (short)255;
    }

    public static short marketSegmentIDMinValue()
    {
        return (short)0;
    }

    public static short marketSegmentIDMaxValue()
    {
        return (short)254;
    }

    public short marketSegmentID()
    {
        return ((short)(buffer.getByte(offset + 45) & 0xFF));
    }


    public static int sideId()
    {
        return 54;
    }

    public static int sideSinceVersion()
    {
        return 0;
    }

    public static int sideEncodingOffset()
    {
        return 46;
    }

    public static int sideEncodingLength()
    {
        return 1;
    }

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

        return "";
    }

    public byte sideRaw()
    {
        return buffer.getByte(offset + 46);
    }

    public Side side()
    {
        return Side.get(buffer.getByte(offset + 46));
    }


    public static int ordTypeId()
    {
        return 40;
    }

    public static int ordTypeSinceVersion()
    {
        return 0;
    }

    public static int ordTypeEncodingOffset()
    {
        return 47;
    }

    public static int ordTypeEncodingLength()
    {
        return 1;
    }

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

        return "";
    }

    public byte ordTypeRaw()
    {
        return buffer.getByte(offset + 47);
    }

    public OrdType ordType()
    {
        return OrdType.get(buffer.getByte(offset + 47));
    }


    public static int ordTagIDId()
    {
        return 35505;
    }

    public static int ordTagIDSinceVersion()
    {
        return 0;
    }

    public static int ordTagIDEncodingOffset()
    {
        return 48;
    }

    public static int ordTagIDEncodingLength()
    {
        return 1;
    }

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

        return "";
    }

    public static short ordTagIDNullValue()
    {
        return (short)0;
    }

    public static short ordTagIDMinValue()
    {
        return (short)0;
    }

    public static short ordTagIDMaxValue()
    {
        return (short)254;
    }

    public short ordTagID()
    {
        return ((short)(buffer.getByte(offset + 48) & 0xFF));
    }


    public static int mmProtectionResetId()
    {
        return 9773;
    }

    public static int mmProtectionResetSinceVersion()
    {
        return 0;
    }

    public static int mmProtectionResetEncodingOffset()
    {
        return 49;
    }

    public static int mmProtectionResetEncodingLength()
    {
        return 1;
    }

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

        return "";
    }

    public short mmProtectionResetRaw()
    {
        return ((short)(buffer.getByte(offset + 49) & 0xFF));
    }

    public Boolean mmProtectionReset()
    {
        return Boolean.get(((short)(buffer.getByte(offset + 49) & 0xFF)));
    }


    public static int routingInstructionId()
    {
        return 35487;
    }

    public static int routingInstructionSinceVersion()
    {
        return 0;
    }

    public static int routingInstructionEncodingOffset()
    {
        return 50;
    }

    public static int routingInstructionEncodingLength()
    {
        return 1;
    }

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

        return "";
    }

    public short routingInstructionRaw()
    {
        return ((short)(buffer.getByte(offset + 50) & 0xFF));
    }

    public RoutingInstruction routingInstruction()
    {
        return RoutingInstruction.get(((short)(buffer.getByte(offset + 50) & 0xFF)));
    }


    public static int timeInForceId()
    {
        return 59;
    }

    public static int timeInForceSinceVersion()
    {
        return 0;
    }

    public static int timeInForceEncodingOffset()
    {
        return 51;
    }

    public static int timeInForceEncodingLength()
    {
        return 1;
    }

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

        return "";
    }

    public byte timeInForceRaw()
    {
        return buffer.getByte(offset + 51);
    }

    public TimeInForce timeInForce()
    {
        return TimeInForce.get(buffer.getByte(offset + 51));
    }


    public static int minQtyId()
    {
        return 110;
    }

    public static int minQtySinceVersion()
    {
        return 0;
    }

    public static int minQtyEncodingOffset()
    {
        return 56;
    }

    public static int minQtyEncodingLength()
    {
        return 8;
    }

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

        return "";
    }

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

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

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

    public long minQty()
    {
        return buffer.getLong(offset + 56, java.nio.ByteOrder.LITTLE_ENDIAN);
    }


    public static int maxFloorId()
    {
        return 111;
    }

    public static int maxFloorSinceVersion()
    {
        return 0;
    }

    public static int maxFloorEncodingOffset()
    {
        return 64;
    }

    public static int maxFloorEncodingLength()
    {
        return 8;
    }

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

        return "";
    }

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

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

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

    public long maxFloor()
    {
        return buffer.getLong(offset + 64, java.nio.ByteOrder.LITTLE_ENDIAN);
    }


    public static int investorIDId()
    {
        return 35504;
    }

    public static int investorIDSinceVersion()
    {
        return 0;
    }

    public static int investorIDEncodingOffset()
    {
        return 72;
    }

    public static int investorIDEncodingLength()
    {
        return 4;
    }

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

        return "";
    }

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

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

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

    public long investorID()
    {
        return (buffer.getInt(offset + 72, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF_FFFFL);
    }


    public static int custodianInfoId()
    {
        return 35507;
    }

    public static int custodianInfoSinceVersion()
    {
        return 0;
    }

    public static int custodianInfoEncodingOffset()
    {
        return 76;
    }

    public static int custodianInfoEncodingLength()
    {
        return 12;
    }

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

        return "";
    }

    private final CustodianInfoDecoder custodianInfo = new CustodianInfoDecoder();

    /**
     * Identifies the custodian.
     *
     * @return CustodianInfoDecoder : Identifies the custodian.
     */
    public CustodianInfoDecoder custodianInfo()
    {
        custodianInfo.wrap(buffer, offset + 76);
        return custodianInfo;
    }

    public static int expireDateId()
    {
        return 432;
    }

    public static int expireDateSinceVersion()
    {
        return 0;
    }

    public static int expireDateEncodingOffset()
    {
        return 88;
    }

    public static int expireDateEncodingLength()
    {
        return 2;
    }

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

        return "";
    }

    public static int expireDateNullValue()
    {
        return 0;
    }

    public static int expireDateMinValue()
    {
        return 0;
    }

    public static int expireDateMaxValue()
    {
        return 65534;
    }

    public int expireDate()
    {
        return (buffer.getShort(offset + 88, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF);
    }


    public static int stopPxId()
    {
        return 99;
    }

    public static int stopPxSinceVersion()
    {
        return 0;
    }

    public static int stopPxEncodingOffset()
    {
        return 90;
    }

    public static int stopPxEncodingLength()
    {
        return 8;
    }

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

        return "";
    }

    private final PriceOptionalDecoder stopPx = new PriceOptionalDecoder();

    /**
     * The stop price of a stop limit order (Conditionally required if OrdType = 4).
     *
     * @return PriceOptionalDecoder : The stop price of a stop limit order (Conditionally required if OrdType = 4).
     */
    public PriceOptionalDecoder stopPx()
    {
        stopPx.wrap(buffer, offset + 90);
        return stopPx;
    }

    public static int senderLocationId()
    {
        return 35503;
    }

    public static int senderLocationSinceVersion()
    {
        return 0;
    }

    public static int senderLocationEncodingOffset()
    {
        return 98;
    }

    public static int senderLocationEncodingLength()
    {
        return 10;
    }

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

        return "";
    }

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

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

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

    public static int senderLocationLength()
    {
        return 10;
    }


    public byte senderLocation(final int index)
    {
        if (index < 0 || index >= 10)
        {
            throw new IndexOutOfBoundsException("index out of range: index=" + index);
        }

        final int pos = offset + 98 + (index * 1);

        return buffer.getByte(pos);
    }


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

    public int getSenderLocation(final byte[] dst, final int dstOffset)
    {
        final int length = 10;
        if (dstOffset < 0 || dstOffset > (dst.length - length))
        {
            throw new IndexOutOfBoundsException("Copy will go out of range: offset=" + dstOffset);
        }

        buffer.getBytes(offset + 98, dst, dstOffset, length);

        return length;
    }

    public String senderLocation()
    {
        final byte[] dst = new byte[10];
        buffer.getBytes(offset + 98, dst, 0, 10);

        int end = 0;
        for (; end < 10 && dst[end] != 0; ++end);

        return new String(dst, 0, end, java.nio.charset.StandardCharsets.US_ASCII);
    }


    public int getSenderLocation(final Appendable value)
    {
        for (int i = 0; i < 10; ++i)
        {
            final int c = buffer.getByte(offset + 98 + i) & 0xFF;
            if (c == 0)
            {
                return i;
            }

            try
            {
                value.append(c > 127 ? '?' : (char)c);
            }
            catch (final java.io.IOException ex)
            {
                throw new java.io.UncheckedIOException(ex);
            }
        }

        return 10;
    }


    public static int enteringTraderId()
    {
        return 35502;
    }

    public static int enteringTraderSinceVersion()
    {
        return 0;
    }

    public static int enteringTraderEncodingOffset()
    {
        return 108;
    }

    public static int enteringTraderEncodingLength()
    {
        return 5;
    }

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

        return "";
    }

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

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

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

    public static int enteringTraderLength()
    {
        return 5;
    }


    public byte enteringTrader(final int index)
    {
        if (index < 0 || index >= 5)
        {
            throw new IndexOutOfBoundsException("index out of range: index=" + index);
        }

        final int pos = offset + 108 + (index * 1);

        return buffer.getByte(pos);
    }


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

    public int getEnteringTrader(final byte[] dst, final int dstOffset)
    {
        final int length = 5;
        if (dstOffset < 0 || dstOffset > (dst.length - length))
        {
            throw new IndexOutOfBoundsException("Copy will go out of range: offset=" + dstOffset);
        }

        buffer.getBytes(offset + 108, dst, dstOffset, length);

        return length;
    }

    public String enteringTrader()
    {
        final byte[] dst = new byte[5];
        buffer.getBytes(offset + 108, dst, 0, 5);

        int end = 0;
        for (; end < 5 && dst[end] != 0; ++end);

        return new String(dst, 0, end, java.nio.charset.StandardCharsets.US_ASCII);
    }


    public int getEnteringTrader(final Appendable value)
    {
        for (int i = 0; i < 5; ++i)
        {
            final int c = buffer.getByte(offset + 108 + i) & 0xFF;
            if (c == 0)
            {
                return i;
            }

            try
            {
                value.append(c > 127 ? '?' : (char)c);
            }
            catch (final java.io.IOException ex)
            {
                throw new java.io.UncheckedIOException(ex);
            }
        }

        return 5;
    }


    public static int executingTraderId()
    {
        return 35506;
    }

    public static int executingTraderSinceVersion()
    {
        return 0;
    }

    public static int executingTraderEncodingOffset()
    {
        return 113;
    }

    public static int executingTraderEncodingLength()
    {
        return 5;
    }

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

        return "";
    }

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

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

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

    public static int executingTraderLength()
    {
        return 5;
    }


    public byte executingTrader(final int index)
    {
        if (index < 0 || index >= 5)
        {
            throw new IndexOutOfBoundsException("index out of range: index=" + index);
        }

        final int pos = offset + 113 + (index * 1);

        return buffer.getByte(pos);
    }


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

    public int getExecutingTrader(final byte[] dst, final int dstOffset)
    {
        final int length = 5;
        if (dstOffset < 0 || dstOffset > (dst.length - length))
        {
            throw new IndexOutOfBoundsException("Copy will go out of range: offset=" + dstOffset);
        }

        buffer.getBytes(offset + 113, dst, dstOffset, length);

        return length;
    }

    public String executingTrader()
    {
        final byte[] dst = new byte[5];
        buffer.getBytes(offset + 113, dst, 0, 5);

        int end = 0;
        for (; end < 5 && dst[end] != 0; ++end);

        return new String(dst, 0, end, java.nio.charset.StandardCharsets.US_ASCII);
    }


    public int getExecutingTrader(final Appendable value)
    {
        for (int i = 0; i < 5; ++i)
        {
            final int c = buffer.getByte(offset + 113 + i) & 0xFF;
            if (c == 0)
            {
                return i;
            }

            try
            {
                value.append(c > 127 ? '?' : (char)c);
            }
            catch (final java.io.IOException ex)
            {
                throw new java.io.UncheckedIOException(ex);
            }
        }

        return 5;
    }


    public static int selfTradePreventionInstructionId()
    {
        return 35539;
    }

    public static int selfTradePreventionInstructionSinceVersion()
    {
        return 0;
    }

    public static int selfTradePreventionInstructionEncodingOffset()
    {
        return 118;
    }

    public static int selfTradePreventionInstructionEncodingLength()
    {
        return 1;
    }

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

        return "";
    }

    public byte selfTradePreventionInstructionRaw()
    {
        return buffer.getByte(offset + 118);
    }

    public SelfTradePreventionInstruction selfTradePreventionInstruction()
    {
        return SelfTradePreventionInstruction.get(buffer.getByte(offset + 118));
    }


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

        final OrderCancelReplaceRequestDecoder decoder = new OrderCancelReplaceRequestDecoder();
        decoder.wrap(buffer, initialOffset, actingBlockLength, actingVersion);

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

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

        final int originalLimit = limit();
        limit(initialOffset + actingBlockLength);
        builder.append("[OrderCancelReplaceRequest](sbeTemplateId=");
        builder.append(TEMPLATE_ID);
        builder.append("|sbeSchemaId=");
        builder.append(SCHEMA_ID);
        builder.append("|sbeSchemaVersion=");
        if (parentMessage.actingVersion != SCHEMA_VERSION)
        {
            builder.append(parentMessage.actingVersion);
            builder.append('/');
        }
        builder.append(SCHEMA_VERSION);
        builder.append("|sbeBlockLength=");
        if (actingBlockLength != BLOCK_LENGTH)
        {
            builder.append(actingBlockLength);
            builder.append('/');
        }
        builder.append(BLOCK_LENGTH);
        builder.append("):");
        builder.append("messageType=");
        builder.append(this.messageType());
        builder.append('|');
        builder.append("origClOrdID=");
        builder.append(this.origClOrdID());
        builder.append('|');
        builder.append("clOrdID=");
        builder.append(this.clOrdID());
        builder.append('|');
        builder.append("securityID=");
        builder.append(this.securityID());
        builder.append('|');
        builder.append("price=");
        final PriceOptionalDecoder price = this.price();
        if (price != null)
        {
            price.appendTo(builder);
        }
        else
        {
            builder.append("null");
        }
        builder.append('|');
        builder.append("orderQty=");
        builder.append(this.orderQty());
        builder.append('|');
        builder.append("account=");
        builder.append(this.account());
        builder.append('|');
        builder.append("accountType=");
        builder.append(this.accountType());
        builder.append('|');
        builder.append("marketSegmentID=");
        builder.append(this.marketSegmentID());
        builder.append('|');
        builder.append("side=");
        builder.append(this.side());
        builder.append('|');
        builder.append("ordType=");
        builder.append(this.ordType());
        builder.append('|');
        builder.append("ordTagID=");
        builder.append(this.ordTagID());
        builder.append('|');
        builder.append("mmProtectionReset=");
        builder.append(this.mmProtectionReset());
        builder.append('|');
        builder.append("routingInstruction=");
        builder.append(this.routingInstruction());
        builder.append('|');
        builder.append("timeInForce=");
        builder.append(this.timeInForce());
        builder.append('|');
        builder.append("minQty=");
        builder.append(this.minQty());
        builder.append('|');
        builder.append("maxFloor=");
        builder.append(this.maxFloor());
        builder.append('|');
        builder.append("investorID=");
        builder.append(this.investorID());
        builder.append('|');
        builder.append("custodianInfo=");
        final CustodianInfoDecoder custodianInfo = this.custodianInfo();
        if (custodianInfo != null)
        {
            custodianInfo.appendTo(builder);
        }
        else
        {
            builder.append("null");
        }
        builder.append('|');
        builder.append("expireDate=");
        builder.append(this.expireDate());
        builder.append('|');
        builder.append("stopPx=");
        final PriceOptionalDecoder stopPx = this.stopPx();
        if (stopPx != null)
        {
            stopPx.appendTo(builder);
        }
        else
        {
            builder.append("null");
        }
        builder.append('|');
        builder.append("senderLocation=");
        for (int i = 0; i < senderLocationLength() && this.senderLocation(i) > 0; i++)
        {
            builder.append((char)this.senderLocation(i));
        }
        builder.append('|');
        builder.append("enteringTrader=");
        for (int i = 0; i < enteringTraderLength() && this.enteringTrader(i) > 0; i++)
        {
            builder.append((char)this.enteringTrader(i));
        }
        builder.append('|');
        builder.append("executingTrader=");
        for (int i = 0; i < executingTraderLength() && this.executingTrader(i) > 0; i++)
        {
            builder.append((char)this.executingTrader(i));
        }
        builder.append('|');
        builder.append("selfTradePreventionInstruction=");
        builder.append(this.selfTradePreventionInstruction());

        limit(originalLimit);

        return builder;
    }
    
    public OrderCancelReplaceRequestDecoder sbeSkip()
    {
        sbeRewind();

        return this;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy