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

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

There is a newer version: 0.157
Show newest version
/* Generated SBE (Simple Binary Encoding) message codec. */
package b3.entrypoint.fixp.sbe;

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


/**
 * AllocationReport message is as response of AllocationInstruction message.
 */
@SuppressWarnings("all")
public final class AllocationReportDecoder implements MessageDecoderFlyweight
{
    public static final int BLOCK_LENGTH = 52;
    public static final int TEMPLATE_ID = 602;
    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 AllocationReportDecoder 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 AllocationReportDecoder 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 AllocationReportDecoder 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 AllocationReportDecoder 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.AllocationReport.value();
    }


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


    public static int allocReportIDId()
    {
        return 755;
    }

    public static int allocReportIDSinceVersion()
    {
        return 0;
    }

    public static int allocReportIDEncodingOffset()
    {
        return 0;
    }

    public static int allocReportIDEncodingLength()
    {
        return 8;
    }

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

        return "";
    }

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

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

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

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


    public static int allocIDId()
    {
        return 70;
    }

    public static int allocIDSinceVersion()
    {
        return 0;
    }

    public static int allocIDEncodingOffset()
    {
        return 8;
    }

    public static int allocIDEncodingLength()
    {
        return 8;
    }

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

        return "";
    }

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

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

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

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


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


    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 transactTimeId()
    {
        return 60;
    }

    public static int transactTimeSinceVersion()
    {
        return 0;
    }

    public static int transactTimeEncodingOffset()
    {
        return 24;
    }

    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 + 24);
        return transactTime;
    }

    public static int quantityId()
    {
        return 53;
    }

    public static int quantitySinceVersion()
    {
        return 0;
    }

    public static int quantityEncodingOffset()
    {
        return 32;
    }

    public static int quantityEncodingLength()
    {
        return 8;
    }

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

        return "";
    }

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

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

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

    public long quantity()
    {
        return buffer.getLong(offset + 32, BYTE_ORDER);
    }


    public static int tradeDateId()
    {
        return 75;
    }

    public static int tradeDateSinceVersion()
    {
        return 0;
    }

    public static int tradeDateEncodingOffset()
    {
        return 40;
    }

    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 int tradeDate()
    {
        return (buffer.getShort(offset + 40, BYTE_ORDER) & 0xFFFF);
    }


    public static int allocTransTypeId()
    {
        return 71;
    }

    public static int allocTransTypeSinceVersion()
    {
        return 0;
    }

    public static int allocTransTypeEncodingOffset()
    {
        return 42;
    }

    public static int allocTransTypeEncodingLength()
    {
        return 1;
    }

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

        return "";
    }

    public byte allocTransTypeRaw()
    {
        return buffer.getByte(offset + 42);
    }

    public AllocTransType allocTransType()
    {
        return AllocTransType.get(buffer.getByte(offset + 42));
    }


    public static int allocReportTypeId()
    {
        return 794;
    }

    public static int allocReportTypeSinceVersion()
    {
        return 0;
    }

    public static int allocReportTypeEncodingOffset()
    {
        return 43;
    }

    public static int allocReportTypeEncodingLength()
    {
        return 1;
    }

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

        return "";
    }

    public byte allocReportTypeRaw()
    {
        return buffer.getByte(offset + 43);
    }

    public AllocReportType allocReportType()
    {
        return AllocReportType.get(buffer.getByte(offset + 43));
    }


    public static int allocStatusId()
    {
        return 87;
    }

    public static int allocStatusSinceVersion()
    {
        return 0;
    }

    public static int allocStatusEncodingOffset()
    {
        return 44;
    }

    public static int allocStatusEncodingLength()
    {
        return 1;
    }

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

        return "";
    }

    public byte allocStatusRaw()
    {
        return buffer.getByte(offset + 44);
    }

    public AllocStatus allocStatus()
    {
        return AllocStatus.get(buffer.getByte(offset + 44));
    }


    public static int allocNoOrdersTypeId()
    {
        return 857;
    }

    public static int allocNoOrdersTypeSinceVersion()
    {
        return 0;
    }

    public static int allocNoOrdersTypeEncodingOffset()
    {
        return 45;
    }

    public static int allocNoOrdersTypeEncodingLength()
    {
        return 1;
    }

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

        return "";
    }

    public byte allocNoOrdersTypeRaw()
    {
        return buffer.getByte(offset + 45);
    }

    public AllocNoOrdersType allocNoOrdersType()
    {
        return AllocNoOrdersType.get(buffer.getByte(offset + 45));
    }


    public static int allocRejCodeId()
    {
        return 88;
    }

    public static int allocRejCodeSinceVersion()
    {
        return 0;
    }

    public static int allocRejCodeEncodingOffset()
    {
        return 46;
    }

    public static int allocRejCodeEncodingLength()
    {
        return 4;
    }

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

        return "";
    }

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

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

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

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


    public static int sideId()
    {
        return 54;
    }

    public static int sideSinceVersion()
    {
        return 0;
    }

    public static int sideEncodingOffset()
    {
        return 50;
    }

    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 + 50);
    }

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


    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 String toString()
    {
        if (null == buffer)
        {
            return "";
        }

        final AllocationReportDecoder decoder = new AllocationReportDecoder();
        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("[AllocationReport](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("allocReportID=");
        builder.append(this.allocReportID());
        builder.append('|');
        builder.append("allocID=");
        builder.append(this.allocID());
        builder.append('|');
        builder.append("securityID=");
        builder.append(this.securityID());
        builder.append('|');
        builder.append("transactTime=");
        final UTCTimestampNanosDecoder transactTime = this.transactTime();
        if (null != transactTime)
        {
            transactTime.appendTo(builder);
        }
        else
        {
            builder.append("null");
        }
        builder.append('|');
        builder.append("quantity=");
        builder.append(this.quantity());
        builder.append('|');
        builder.append("tradeDate=");
        builder.append(this.tradeDate());
        builder.append('|');
        builder.append("allocTransType=");
        builder.append(this.allocTransType());
        builder.append('|');
        builder.append("allocReportType=");
        builder.append(this.allocReportType());
        builder.append('|');
        builder.append("allocStatus=");
        builder.append(this.allocStatus());
        builder.append('|');
        builder.append("allocNoOrdersType=");
        builder.append(this.allocNoOrdersType());
        builder.append('|');
        builder.append("allocRejCode=");
        builder.append(this.allocRejCode());
        builder.append('|');
        builder.append("side=");
        builder.append(this.side());
        builder.append('|');
        builder.append("possResend=");
        builder.append(this.possResend());

        limit(originalLimit);

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

        return this;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy