io.zeebe.clustering.raft.PollResponseDecoder Maven / Gradle / Ivy
/* 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.PollResponseDecoder"})
@SuppressWarnings("all")
public class PollResponseDecoder implements MessageDecoderFlyweight
{
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 PollResponseDecoder parentMessage = this;
private DirectBuffer buffer;
protected int offset;
protected int limit;
protected int actingBlockLength;
protected 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 PollResponseDecoder wrap(
final DirectBuffer buffer, final int offset, final int actingBlockLength, final int actingVersion)
{
this.buffer = buffer;
this.offset = offset;
this.actingBlockLength = actingBlockLength;
this.actingVersion = actingVersion;
limit(offset + actingBlockLength);
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 termId()
{
return 1;
}
public static int termSinceVersion()
{
return 0;
}
public static int termEncodingOffset()
{
return 0;
}
public static int termEncodingLength()
{
return 2;
}
public static String termMetaAttribute(final MetaAttribute metaAttribute)
{
switch (metaAttribute)
{
case EPOCH: return "unix";
case TIME_UNIT: return "nanosecond";
case SEMANTIC_TYPE: return "";
}
return "";
}
public static int termNullValue()
{
return 65535;
}
public static int termMinValue()
{
return 0;
}
public static int termMaxValue()
{
return 65534;
}
public int term()
{
return (buffer.getShort(offset + 0, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF);
}
public static int grantedId()
{
return 2;
}
public static int grantedSinceVersion()
{
return 0;
}
public static int grantedEncodingOffset()
{
return 2;
}
public static int grantedEncodingLength()
{
return 1;
}
public static String grantedMetaAttribute(final MetaAttribute metaAttribute)
{
switch (metaAttribute)
{
case EPOCH: return "unix";
case TIME_UNIT: return "nanosecond";
case SEMANTIC_TYPE: return "";
}
return "";
}
public BooleanType granted()
{
return BooleanType.get(((short)(buffer.getByte(offset + 2) & 0xFF)));
}
public String toString()
{
return appendTo(new StringBuilder(100)).toString();
}
public StringBuilder appendTo(final StringBuilder builder)
{
final int originalLimit = limit();
limit(offset + actingBlockLength);
builder.append("[PollResponse](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("):");
//Token{signal=BEGIN_FIELD, name='term', description='null', id=1, version=0, deprecated=0, encodedLength=0, offset=0, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='null'}}
//Token{signal=ENCODING, name='uint16', description='null', id=-1, version=0, deprecated=0, encodedLength=2, offset=0, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=UINT16, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='null'}}
builder.append("term=");
builder.append(term());
builder.append('|');
//Token{signal=BEGIN_FIELD, name='granted', description='null', id=2, version=0, deprecated=0, encodedLength=0, offset=2, componentTokenCount=6, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='null'}}
//Token{signal=BEGIN_ENUM, name='BooleanType', description='null', id=-1, version=0, deprecated=0, encodedLength=1, offset=2, componentTokenCount=4, encoding=Encoding{presence=REQUIRED, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='Boolean'}}
builder.append("granted=");
builder.append(granted());
limit(originalLimit);
return builder;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy