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

io.zeebe.clustering.raft.PollResponseEncoder Maven / Gradle / Ivy

There is a newer version: 0.21.0-alpha1
Show newest version
/* Generated SBE (Simple Binary Encoding) message codec */
package io.zeebe.clustering.raft;

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

@javax.annotation.Generated(value = {"io.zeebe.clustering.raft.PollResponseEncoder"})
@SuppressWarnings("all")
public class PollResponseEncoder implements MessageEncoderFlyweight
{
    public static final int BLOCK_LENGTH = 3;
    public static final int TEMPLATE_ID = 7;
    public static final int SCHEMA_ID = 4;
    public static final int SCHEMA_VERSION = 1;

    private final PollResponseEncoder parentMessage = this;
    private MutableDirectBuffer buffer;
    protected int offset;
    protected int limit;

    public int sbeBlockLength()
    {
        return BLOCK_LENGTH;
    }

    public int sbeTemplateId()
    {
        return TEMPLATE_ID;
    }

    public int sbeSchemaId()
    {
        return SCHEMA_ID;
    }

    public int sbeSchemaVersion()
    {
        return SCHEMA_VERSION;
    }

    public String sbeSemanticType()
    {
        return "";
    }

    public MutableDirectBuffer buffer()
    {
        return buffer;
    }

    public int offset()
    {
        return offset;
    }

    public PollResponseEncoder wrap(final MutableDirectBuffer buffer, final int offset)
    {
        this.buffer = buffer;
        this.offset = offset;
        limit(offset + BLOCK_LENGTH);

        return this;
    }

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

    public int limit()
    {
        return limit;
    }

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

    public static int termEncodingOffset()
    {
        return 0;
    }

    public static int termEncodingLength()
    {
        return 2;
    }

    public static int termNullValue()
    {
        return 65535;
    }

    public static int termMinValue()
    {
        return 0;
    }

    public static int termMaxValue()
    {
        return 65534;
    }

    public PollResponseEncoder term(final int value)
    {
        buffer.putShort(offset + 0, (short)value, java.nio.ByteOrder.LITTLE_ENDIAN);
        return this;
    }


    public static int grantedEncodingOffset()
    {
        return 2;
    }

    public static int grantedEncodingLength()
    {
        return 1;
    }

    public PollResponseEncoder granted(final BooleanType value)
    {
        buffer.putByte(offset + 2, (byte)value.value());
        return this;
    }


    public String toString()
    {
        return appendTo(new StringBuilder(100)).toString();
    }

    public StringBuilder appendTo(final StringBuilder builder)
    {
        PollResponseDecoder writer = new PollResponseDecoder();
        writer.wrap(buffer, offset, BLOCK_LENGTH, SCHEMA_VERSION);

        return writer.appendTo(builder);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy