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

b3.entrypoint.fixp.sbe.PositionMaintenanceReportDecoder 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.*;


/**
 * PositionMaintenanceReport message is sent by the holder of a position in response to a PositionMaintenanceRequest message and is used to confirm that a request has been successfully processed or rejected.
 */
@SuppressWarnings("all")
public final class PositionMaintenanceReportDecoder implements MessageDecoderFlyweight
{
    public static final int BLOCK_LENGTH = 72;
    public static final int TEMPLATE_ID = 503;
    public static final int SCHEMA_ID = 1;
    public static final int SCHEMA_VERSION = 5;
    public static final String SEMANTIC_VERSION = "5.6";
    public static final java.nio.ByteOrder BYTE_ORDER = java.nio.ByteOrder.LITTLE_ENDIAN;

    private final PositionMaintenanceReportDecoder parentMessage = this;
    private DirectBuffer buffer;
    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 offset()
    {
        return offset;
    }

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

        return this;
    }

    public PositionMaintenanceReportDecoder 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 PositionMaintenanceReportDecoder sbeRewind()
    {
        return wrap(buffer, offset, actingBlockLength, actingVersion);
    }

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

        return decodedLength;
    }

    public int actingVersion()
    {
        return actingVersion;
    }

    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.PositionMaintenanceReport.value();
    }


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


    public static int posMaintRptIDId()
    {
        return 721;
    }

    public static int posMaintRptIDSinceVersion()
    {
        return 0;
    }

    public static int posMaintRptIDEncodingOffset()
    {
        return 0;
    }

    public static int posMaintRptIDEncodingLength()
    {
        return 8;
    }

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

        return "";
    }

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

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

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

    public long posMaintRptID()
    {
        return buffer.getLong(offset + 0, BYTE_ORDER);
    }


    public static int posReqIDId()
    {
        return 710;
    }

    public static int posReqIDSinceVersion()
    {
        return 0;
    }

    public static int posReqIDEncodingOffset()
    {
        return 8;
    }

    public static int posReqIDEncodingLength()
    {
        return 8;
    }

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

        return "";
    }

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

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

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

    public long posReqID()
    {
        return buffer.getLong(offset + 8, BYTE_ORDER);
    }


    public static int origPosReqRefIDId()
    {
        return 713;
    }

    public static int origPosReqRefIDSinceVersion()
    {
        return 0;
    }

    public static int origPosReqRefIDEncodingOffset()
    {
        return 16;
    }

    public static int origPosReqRefIDEncodingLength()
    {
        return 8;
    }

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

        return "";
    }

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

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

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

    public long origPosReqRefID()
    {
        return buffer.getLong(offset + 16, BYTE_ORDER);
    }


    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 long securityID()
    {
        return buffer.getLong(offset + 24, BYTE_ORDER);
    }


    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 posMaintResultId()
    {
        return 723;
    }

    public static int posMaintResultSinceVersion()
    {
        return 0;
    }

    public static int posMaintResultEncodingOffset()
    {
        return 32;
    }

    public static int posMaintResultEncodingLength()
    {
        return 4;
    }

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

        return "";
    }

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

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

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

    public long posMaintResult()
    {
        return (buffer.getInt(offset + 32, BYTE_ORDER) & 0xFFFF_FFFFL);
    }


    public static int tradeIDId()
    {
        return 1003;
    }

    public static int tradeIDSinceVersion()
    {
        return 0;
    }

    public static int tradeIDEncodingOffset()
    {
        return 36;
    }

    public static int tradeIDEncodingLength()
    {
        return 4;
    }

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

        return "";
    }

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

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

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

    public long tradeID()
    {
        return (buffer.getInt(offset + 36, BYTE_ORDER) & 0xFFFF_FFFFL);
    }


    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, BYTE_ORDER) & 0xFFFF_FFFFL);
    }


    public static int clearingBusinessDateId()
    {
        return 715;
    }

    public static int clearingBusinessDateSinceVersion()
    {
        return 0;
    }

    public static int clearingBusinessDateEncodingOffset()
    {
        return 44;
    }

    public static int clearingBusinessDateEncodingLength()
    {
        return 2;
    }

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

        return "";
    }

    public static int clearingBusinessDateNullValue()
    {
        return 0;
    }

    public static int clearingBusinessDateMinValue()
    {
        return 0;
    }

    public static int clearingBusinessDateMaxValue()
    {
        return 65534;
    }

    public int clearingBusinessDate()
    {
        return (buffer.getShort(offset + 44, BYTE_ORDER) & 0xFFFF);
    }


    public static int posTransTypeId()
    {
        return 709;
    }

    public static int posTransTypeSinceVersion()
    {
        return 0;
    }

    public static int posTransTypeEncodingOffset()
    {
        return 46;
    }

    public static int posTransTypeEncodingLength()
    {
        return 1;
    }

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

        return "";
    }

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

    public PosTransType posTransType()
    {
        return PosTransType.get(((short)(buffer.getByte(offset + 46) & 0xFF)));
    }


    public static int posMaintActionId()
    {
        return 712;
    }

    public static int posMaintActionSinceVersion()
    {
        return 0;
    }

    public static int posMaintActionEncodingOffset()
    {
        return 47;
    }

    public static int posMaintActionEncodingLength()
    {
        return 1;
    }

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

        return "";
    }

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

    public PosMaintAction posMaintAction()
    {
        return PosMaintAction.get(buffer.getByte(offset + 47));
    }


    public static int posMaintStatusId()
    {
        return 722;
    }

    public static int posMaintStatusSinceVersion()
    {
        return 0;
    }

    public static int posMaintStatusEncodingOffset()
    {
        return 48;
    }

    public static int posMaintStatusEncodingLength()
    {
        return 1;
    }

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

        return "";
    }

    public byte posMaintStatusRaw()
    {
        return buffer.getByte(offset + 48);
    }

    public PosMaintStatus posMaintStatus()
    {
        return PosMaintStatus.get(buffer.getByte(offset + 48));
    }


    public static int accountTypeId()
    {
        return 581;
    }

    public static int accountTypeSinceVersion()
    {
        return 0;
    }

    public static int accountTypeEncodingOffset()
    {
        return 49;
    }

    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 + 49) & 0xFF));
    }

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


    public static int contraryInstructionIndicatorId()
    {
        return 719;
    }

    public static int contraryInstructionIndicatorSinceVersion()
    {
        return 0;
    }

    public static int contraryInstructionIndicatorEncodingOffset()
    {
        return 50;
    }

    public static int contraryInstructionIndicatorEncodingLength()
    {
        return 1;
    }

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

        return "";
    }

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

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


    public static int possResendId()
    {
        return 97;
    }

    public static int possResendSinceVersion()
    {
        return 0;
    }

    public static int possResendEncodingOffset()
    {
        return 51;
    }

    public static int possResendEncodingLength()
    {
        return 1;
    }

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

        return "";
    }

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

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


    public static int thresholdAmountId()
    {
        return 834;
    }

    public static int thresholdAmountSinceVersion()
    {
        return 0;
    }

    public static int thresholdAmountEncodingOffset()
    {
        return 56;
    }

    public static int thresholdAmountEncodingLength()
    {
        return 8;
    }

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

        return "";
    }

    private final PriceOffsetOptionalDecoder thresholdAmount = new PriceOffsetOptionalDecoder();

    /**
     * Used to indicate the minimum acceptable offset between the Strike Price and the Market Price.
     *
     * @return PriceOffsetOptionalDecoder : Used to indicate the minimum acceptable offset between the Strike Price and the Market Price.
     */
    public PriceOffsetOptionalDecoder thresholdAmount()
    {
        thresholdAmount.wrap(buffer, offset + 56);
        return thresholdAmount;
    }

    public static int transactTimeId()
    {
        return 60;
    }

    public static int transactTimeSinceVersion()
    {
        return 0;
    }

    public static int transactTimeEncodingOffset()
    {
        return 64;
    }

    public static int transactTimeEncodingLength()
    {
        return 8;
    }

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

        return "";
    }

    private final UTCTimestampNanosDecoder transactTime = new UTCTimestampNanosDecoder();

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

    private final NoPositionsDecoder noPositions = new NoPositionsDecoder(this);

    public static long noPositionsDecoderId()
    {
        return 702;
    }

    public static int noPositionsDecoderSinceVersion()
    {
        return 0;
    }

    public NoPositionsDecoder noPositions()
    {
        noPositions.wrap(buffer);
        return noPositions;
    }

    public static final class NoPositionsDecoder
        implements Iterable, java.util.Iterator
    {
        public static final int HEADER_SIZE = 3;
        private final PositionMaintenanceReportDecoder parentMessage;
        private DirectBuffer buffer;
        private int count;
        private int index;
        private int offset;
        private int blockLength;

        NoPositionsDecoder(final PositionMaintenanceReportDecoder parentMessage)
        {
            this.parentMessage = parentMessage;
        }

        public void wrap(final DirectBuffer buffer)
        {
            if (buffer != this.buffer)
            {
                this.buffer = buffer;
            }

            index = 0;
            final int limit = parentMessage.limit();
            parentMessage.limit(limit + HEADER_SIZE);
            blockLength = (buffer.getShort(limit + 0, BYTE_ORDER) & 0xFFFF);
            count = ((short)(buffer.getByte(limit + 2) & 0xFF));
        }

        public NoPositionsDecoder next()
        {
            if (index >= count)
            {
                throw new java.util.NoSuchElementException();
            }

            offset = parentMessage.limit();
            parentMessage.limit(offset + blockLength);
            ++index;

            return this;
        }

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

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

        public static int sbeHeaderSize()
        {
            return HEADER_SIZE;
        }

        public static int sbeBlockLength()
        {
            return 18;
        }

        public int actingBlockLength()
        {
            return blockLength;
        }

        public int count()
        {
            return count;
        }

        public java.util.Iterator iterator()
        {
            return this;
        }

        public void remove()
        {
            throw new UnsupportedOperationException();
        }

        public boolean hasNext()
        {
            return index < count;
        }

        public static int posTypeId()
        {
            return 703;
        }

        public static int posTypeSinceVersion()
        {
            return 0;
        }

        public static int posTypeEncodingOffset()
        {
            return 0;
        }

        public static int posTypeEncodingLength()
        {
            return 1;
        }

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

            return "";
        }

        public byte posTypeRaw()
        {
            return buffer.getByte(offset + 0);
        }

        public PosType posType()
        {
            return PosType.get(buffer.getByte(offset + 0));
        }


        public static int longQtyId()
        {
            return 704;
        }

        public static int longQtySinceVersion()
        {
            return 0;
        }

        public static int longQtyEncodingOffset()
        {
            return 2;
        }

        public static int longQtyEncodingLength()
        {
            return 8;
        }

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

            return "";
        }

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

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

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

        public long longQty()
        {
            return buffer.getLong(offset + 2, BYTE_ORDER);
        }


        public static int shortQtyId()
        {
            return 705;
        }

        public static int shortQtySinceVersion()
        {
            return 0;
        }

        public static int shortQtyEncodingOffset()
        {
            return 10;
        }

        public static int shortQtyEncodingLength()
        {
            return 8;
        }

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

            return "";
        }

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

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

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

        public long shortQty()
        {
            return buffer.getLong(offset + 10, BYTE_ORDER);
        }


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

            builder.append('(');
            builder.append("posType=");
            builder.append(this.posType());
            builder.append('|');
            builder.append("longQty=");
            builder.append(this.longQty());
            builder.append('|');
            builder.append("shortQty=");
            builder.append(this.shortQty());
            builder.append(')');

            return builder;
        }
        
        public NoPositionsDecoder sbeSkip()
        {

            return this;
        }
    }

    public static int textId()
    {
        return 58;
    }

    public static int textSinceVersion()
    {
        return 0;
    }

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

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

        return "";
    }

    public static int textHeaderLength()
    {
        return 1;
    }

    public int textLength()
    {
        final int limit = parentMessage.limit();
        return ((short)(buffer.getByte(limit) & 0xFF));
    }

    public int skipText()
    {
        final int headerLength = 1;
        final int limit = parentMessage.limit();
        final int dataLength = ((short)(buffer.getByte(limit) & 0xFF));
        final int dataOffset = limit + headerLength;
        parentMessage.limit(dataOffset + dataLength);

        return dataLength;
    }

    public int getText(final MutableDirectBuffer dst, final int dstOffset, final int length)
    {
        final int headerLength = 1;
        final int limit = parentMessage.limit();
        final int dataLength = ((short)(buffer.getByte(limit) & 0xFF));
        final int bytesCopied = Math.min(length, dataLength);
        parentMessage.limit(limit + headerLength + dataLength);
        buffer.getBytes(limit + headerLength, dst, dstOffset, bytesCopied);

        return bytesCopied;
    }

    public int getText(final byte[] dst, final int dstOffset, final int length)
    {
        final int headerLength = 1;
        final int limit = parentMessage.limit();
        final int dataLength = ((short)(buffer.getByte(limit) & 0xFF));
        final int bytesCopied = Math.min(length, dataLength);
        parentMessage.limit(limit + headerLength + dataLength);
        buffer.getBytes(limit + headerLength, dst, dstOffset, bytesCopied);

        return bytesCopied;
    }

    public void wrapText(final DirectBuffer wrapBuffer)
    {
        final int headerLength = 1;
        final int limit = parentMessage.limit();
        final int dataLength = ((short)(buffer.getByte(limit) & 0xFF));
        parentMessage.limit(limit + headerLength + dataLength);
        wrapBuffer.wrap(buffer, limit + headerLength, dataLength);
    }

    public String text()
    {
        final int headerLength = 1;
        final int limit = parentMessage.limit();
        final int dataLength = ((short)(buffer.getByte(limit) & 0xFF));
        parentMessage.limit(limit + headerLength + dataLength);

        if (0 == dataLength)
        {
            return "";
        }

        final byte[] tmp = new byte[dataLength];
        buffer.getBytes(limit + headerLength, tmp, 0, dataLength);

        return new String(tmp, java.nio.charset.StandardCharsets.US_ASCII);
    }

    public int getText(final Appendable appendable)
    {
        final int headerLength = 1;
        final int limit = parentMessage.limit();
        final int dataLength = ((short)(buffer.getByte(limit) & 0xFF));
        final int dataOffset = limit + headerLength;

        parentMessage.limit(dataOffset + dataLength);
        buffer.getStringWithoutLengthAscii(dataOffset, dataLength, appendable);

        return dataLength;
    }

    public static int deskIDId()
    {
        return 35510;
    }

    public static int deskIDSinceVersion()
    {
        return 0;
    }

    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 int deskIDLength()
    {
        final int limit = parentMessage.limit();
        return ((short)(buffer.getByte(limit) & 0xFF));
    }

    public int skipDeskID()
    {
        final int headerLength = 1;
        final int limit = parentMessage.limit();
        final int dataLength = ((short)(buffer.getByte(limit) & 0xFF));
        final int dataOffset = limit + headerLength;
        parentMessage.limit(dataOffset + dataLength);

        return dataLength;
    }

    public int getDeskID(final MutableDirectBuffer dst, final int dstOffset, final int length)
    {
        final int headerLength = 1;
        final int limit = parentMessage.limit();
        final int dataLength = ((short)(buffer.getByte(limit) & 0xFF));
        final int bytesCopied = Math.min(length, dataLength);
        parentMessage.limit(limit + headerLength + dataLength);
        buffer.getBytes(limit + headerLength, dst, dstOffset, bytesCopied);

        return bytesCopied;
    }

    public int getDeskID(final byte[] dst, final int dstOffset, final int length)
    {
        final int headerLength = 1;
        final int limit = parentMessage.limit();
        final int dataLength = ((short)(buffer.getByte(limit) & 0xFF));
        final int bytesCopied = Math.min(length, dataLength);
        parentMessage.limit(limit + headerLength + dataLength);
        buffer.getBytes(limit + headerLength, dst, dstOffset, bytesCopied);

        return bytesCopied;
    }

    public void wrapDeskID(final DirectBuffer wrapBuffer)
    {
        final int headerLength = 1;
        final int limit = parentMessage.limit();
        final int dataLength = ((short)(buffer.getByte(limit) & 0xFF));
        parentMessage.limit(limit + headerLength + dataLength);
        wrapBuffer.wrap(buffer, limit + headerLength, dataLength);
    }

    public String deskID()
    {
        final int headerLength = 1;
        final int limit = parentMessage.limit();
        final int dataLength = ((short)(buffer.getByte(limit) & 0xFF));
        parentMessage.limit(limit + headerLength + dataLength);

        if (0 == dataLength)
        {
            return "";
        }

        final byte[] tmp = new byte[dataLength];
        buffer.getBytes(limit + headerLength, tmp, 0, dataLength);

        return new String(tmp, java.nio.charset.StandardCharsets.US_ASCII);
    }

    public int getDeskID(final Appendable appendable)
    {
        final int headerLength = 1;
        final int limit = parentMessage.limit();
        final int dataLength = ((short)(buffer.getByte(limit) & 0xFF));
        final int dataOffset = limit + headerLength;

        parentMessage.limit(dataOffset + dataLength);
        buffer.getStringWithoutLengthAscii(dataOffset, dataLength, appendable);

        return dataLength;
    }

    public static int memoId()
    {
        return 5149;
    }

    public static int memoSinceVersion()
    {
        return 0;
    }

    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 int memoLength()
    {
        final int limit = parentMessage.limit();
        return ((short)(buffer.getByte(limit) & 0xFF));
    }

    public int skipMemo()
    {
        final int headerLength = 1;
        final int limit = parentMessage.limit();
        final int dataLength = ((short)(buffer.getByte(limit) & 0xFF));
        final int dataOffset = limit + headerLength;
        parentMessage.limit(dataOffset + dataLength);

        return dataLength;
    }

    public int getMemo(final MutableDirectBuffer dst, final int dstOffset, final int length)
    {
        final int headerLength = 1;
        final int limit = parentMessage.limit();
        final int dataLength = ((short)(buffer.getByte(limit) & 0xFF));
        final int bytesCopied = Math.min(length, dataLength);
        parentMessage.limit(limit + headerLength + dataLength);
        buffer.getBytes(limit + headerLength, dst, dstOffset, bytesCopied);

        return bytesCopied;
    }

    public int getMemo(final byte[] dst, final int dstOffset, final int length)
    {
        final int headerLength = 1;
        final int limit = parentMessage.limit();
        final int dataLength = ((short)(buffer.getByte(limit) & 0xFF));
        final int bytesCopied = Math.min(length, dataLength);
        parentMessage.limit(limit + headerLength + dataLength);
        buffer.getBytes(limit + headerLength, dst, dstOffset, bytesCopied);

        return bytesCopied;
    }

    public void wrapMemo(final DirectBuffer wrapBuffer)
    {
        final int headerLength = 1;
        final int limit = parentMessage.limit();
        final int dataLength = ((short)(buffer.getByte(limit) & 0xFF));
        parentMessage.limit(limit + headerLength + dataLength);
        wrapBuffer.wrap(buffer, limit + headerLength, dataLength);
    }

    public String memo()
    {
        final int headerLength = 1;
        final int limit = parentMessage.limit();
        final int dataLength = ((short)(buffer.getByte(limit) & 0xFF));
        parentMessage.limit(limit + headerLength + dataLength);

        if (0 == dataLength)
        {
            return "";
        }

        final byte[] tmp = new byte[dataLength];
        buffer.getBytes(limit + headerLength, tmp, 0, dataLength);

        return new String(tmp, java.nio.charset.StandardCharsets.UTF_8);
    }

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

        final PositionMaintenanceReportDecoder decoder = new PositionMaintenanceReportDecoder();
        decoder.wrap(buffer, offset, actingBlockLength, actingVersion);

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

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

        final int originalLimit = limit();
        limit(offset + actingBlockLength);
        builder.append("[PositionMaintenanceReport](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("posMaintRptID=");
        builder.append(this.posMaintRptID());
        builder.append('|');
        builder.append("posReqID=");
        builder.append(this.posReqID());
        builder.append('|');
        builder.append("origPosReqRefID=");
        builder.append(this.origPosReqRefID());
        builder.append('|');
        builder.append("securityID=");
        builder.append(this.securityID());
        builder.append('|');
        builder.append("posMaintResult=");
        builder.append(this.posMaintResult());
        builder.append('|');
        builder.append("tradeID=");
        builder.append(this.tradeID());
        builder.append('|');
        builder.append("account=");
        builder.append(this.account());
        builder.append('|');
        builder.append("clearingBusinessDate=");
        builder.append(this.clearingBusinessDate());
        builder.append('|');
        builder.append("posTransType=");
        builder.append(this.posTransType());
        builder.append('|');
        builder.append("posMaintAction=");
        builder.append(this.posMaintAction());
        builder.append('|');
        builder.append("posMaintStatus=");
        builder.append(this.posMaintStatus());
        builder.append('|');
        builder.append("accountType=");
        builder.append(this.accountType());
        builder.append('|');
        builder.append("contraryInstructionIndicator=");
        builder.append(this.contraryInstructionIndicator());
        builder.append('|');
        builder.append("possResend=");
        builder.append(this.possResend());
        builder.append('|');
        builder.append("thresholdAmount=");
        final PriceOffsetOptionalDecoder thresholdAmount = this.thresholdAmount();
        if (null != thresholdAmount)
        {
            thresholdAmount.appendTo(builder);
        }
        else
        {
            builder.append("null");
        }
        builder.append('|');
        builder.append("transactTime=");
        final UTCTimestampNanosDecoder transactTime = this.transactTime();
        if (null != transactTime)
        {
            transactTime.appendTo(builder);
        }
        else
        {
            builder.append("null");
        }
        builder.append('|');
        builder.append("noPositions=[");
        final int noPositionsOriginalOffset = noPositions.offset;
        final int noPositionsOriginalIndex = noPositions.index;
        final NoPositionsDecoder noPositions = this.noPositions();
        if (noPositions.count() > 0)
        {
            while (noPositions.hasNext())
            {
                noPositions.next().appendTo(builder);
                builder.append(',');
            }
            builder.setLength(builder.length() - 1);
        }
        noPositions.offset = noPositionsOriginalOffset;
        noPositions.index = noPositionsOriginalIndex;
        builder.append(']');
        builder.append('|');
        builder.append("text=");
        builder.append('\'');
        getText(builder);
        builder.append('\'');
        builder.append('|');
        builder.append("deskID=");
        builder.append('\'');
        getDeskID(builder);
        builder.append('\'');
        builder.append('|');
        builder.append("memo=");
        builder.append('\'').append(memo()).append('\'');

        limit(originalLimit);

        return builder;
    }
    
    public PositionMaintenanceReportDecoder sbeSkip()
    {
        sbeRewind();
        NoPositionsDecoder noPositions = this.noPositions();
        if (noPositions.count() > 0)
        {
            while (noPositions.hasNext())
            {
                noPositions.next();
                noPositions.sbeSkip();
            }
        }
        skipText();
        skipDeskID();
        skipMemo();

        return this;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy