io.zeebe.clustering.gossip.GroupSizeEncodingEncoder Maven / Gradle / Ivy
/* Generated SBE (Simple Binary Encoding) message codec */
package io.zeebe.clustering.gossip;
import org.agrona.MutableDirectBuffer;
import org.agrona.sbe.*;
@SuppressWarnings("all")
public class GroupSizeEncodingEncoder implements CompositeEncoderFlyweight
{
public static final int ENCODED_LENGTH = 3;
public static final java.nio.ByteOrder BYTE_ORDER = java.nio.ByteOrder.LITTLE_ENDIAN;
private int offset;
private MutableDirectBuffer buffer;
public GroupSizeEncodingEncoder wrap(final MutableDirectBuffer buffer, final int offset)
{
this.buffer = buffer;
this.offset = offset;
return this;
}
public MutableDirectBuffer buffer()
{
return buffer;
}
public int offset()
{
return offset;
}
public int encodedLength()
{
return ENCODED_LENGTH;
}
public static int blockLengthEncodingOffset()
{
return 0;
}
public static int blockLengthEncodingLength()
{
return 2;
}
public static int blockLengthNullValue()
{
return 65535;
}
public static int blockLengthMinValue()
{
return 0;
}
public static int blockLengthMaxValue()
{
return 65534;
}
public GroupSizeEncodingEncoder blockLength(final int value)
{
buffer.putShort(offset + 0, (short)value, java.nio.ByteOrder.LITTLE_ENDIAN);
return this;
}
public static int numInGroupEncodingOffset()
{
return 2;
}
public static int numInGroupEncodingLength()
{
return 1;
}
public static short numInGroupNullValue()
{
return (short)255;
}
public static short numInGroupMinValue()
{
return (short)0;
}
public static short numInGroupMaxValue()
{
return (short)254;
}
public GroupSizeEncodingEncoder numInGroup(final short value)
{
buffer.putByte(offset + 2, (byte)value);
return this;
}
public String toString()
{
return appendTo(new StringBuilder(100)).toString();
}
public StringBuilder appendTo(final StringBuilder builder)
{
GroupSizeEncodingDecoder writer = new GroupSizeEncodingDecoder();
writer.wrap(buffer, offset);
return writer.appendTo(builder);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy