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

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

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

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


/**
 * UTC timestamp with nanosecond precision.
 */
@SuppressWarnings("all")
public final class UTCTimestampNanosDecoder implements CompositeDecoderFlyweight
{
    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 int ENCODED_LENGTH = 8;
    public static final java.nio.ByteOrder BYTE_ORDER = java.nio.ByteOrder.LITTLE_ENDIAN;

    private int offset;
    private DirectBuffer buffer;

    public UTCTimestampNanosDecoder wrap(final DirectBuffer buffer, final int offset)
    {
        if (buffer != this.buffer)
        {
            this.buffer = buffer;
        }
        this.offset = offset;

        return this;
    }

    public DirectBuffer buffer()
    {
        return buffer;
    }

    public int offset()
    {
        return offset;
    }

    public int encodedLength()
    {
        return ENCODED_LENGTH;
    }

    public int sbeSchemaId()
    {
        return SCHEMA_ID;
    }

    public int sbeSchemaVersion()
    {
        return SCHEMA_VERSION;
    }

    public static int timeEncodingOffset()
    {
        return 0;
    }

    public static int timeEncodingLength()
    {
        return 8;
    }

    public static int timeSinceVersion()
    {
        return 0;
    }

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

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

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

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


    public static int unitEncodingOffset()
    {
        return 8;
    }

    public static int unitEncodingLength()
    {
        return 0;
    }

    public static int unitSinceVersion()
    {
        return 0;
    }

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

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

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

    public short unit()
    {
        return (short)9;
    }

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

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

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

        builder.append('(');
        builder.append("time=");
        builder.append(this.time());
        builder.append('|');
        builder.append(')');

        return builder;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy