io.zeebe.clustering.management.CreateWorkflowRequestEncoder Maven / Gradle / Ivy
/* Generated SBE (Simple Binary Encoding) message codec */
package io.zeebe.clustering.management;
import org.agrona.MutableDirectBuffer;
import org.agrona.DirectBuffer;
import org.agrona.sbe.*;
@javax.annotation.Generated(value = {"io.zeebe.clustering.management.CreateWorkflowRequestEncoder"})
@SuppressWarnings("all")
public class CreateWorkflowRequestEncoder implements MessageEncoderFlyweight
{
public static final int BLOCK_LENGTH = 20;
public static final int TEMPLATE_ID = 3;
public static final int SCHEMA_ID = 5;
public static final int SCHEMA_VERSION = 1;
private final CreateWorkflowRequestEncoder 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 CreateWorkflowRequestEncoder 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 partitionIdEncodingOffset()
{
return 0;
}
public static int partitionIdEncodingLength()
{
return 2;
}
public static int partitionIdNullValue()
{
return 65535;
}
public static int partitionIdMinValue()
{
return 0;
}
public static int partitionIdMaxValue()
{
return 65534;
}
public CreateWorkflowRequestEncoder partitionId(final int value)
{
buffer.putShort(offset + 0, (short)value, java.nio.ByteOrder.LITTLE_ENDIAN);
return this;
}
public static int workflowKeyEncodingOffset()
{
return 2;
}
public static int workflowKeyEncodingLength()
{
return 8;
}
public static long workflowKeyNullValue()
{
return 0xffffffffffffffffL;
}
public static long workflowKeyMinValue()
{
return 0x0L;
}
public static long workflowKeyMaxValue()
{
return 0xfffffffffffffffeL;
}
public CreateWorkflowRequestEncoder workflowKey(final long value)
{
buffer.putLong(offset + 2, value, java.nio.ByteOrder.LITTLE_ENDIAN);
return this;
}
public static int deploymentKeyEncodingOffset()
{
return 10;
}
public static int deploymentKeyEncodingLength()
{
return 8;
}
public static long deploymentKeyNullValue()
{
return 0xffffffffffffffffL;
}
public static long deploymentKeyMinValue()
{
return 0x0L;
}
public static long deploymentKeyMaxValue()
{
return 0xfffffffffffffffeL;
}
public CreateWorkflowRequestEncoder deploymentKey(final long value)
{
buffer.putLong(offset + 10, value, java.nio.ByteOrder.LITTLE_ENDIAN);
return this;
}
public static int versionEncodingOffset()
{
return 18;
}
public static int versionEncodingLength()
{
return 2;
}
public static int versionNullValue()
{
return 65535;
}
public static int versionMinValue()
{
return 0;
}
public static int versionMaxValue()
{
return 65534;
}
public CreateWorkflowRequestEncoder version(final int value)
{
buffer.putShort(offset + 18, (short)value, java.nio.ByteOrder.LITTLE_ENDIAN);
return this;
}
public static int bpmnProcessIdId()
{
return 4;
}
public static String bpmnProcessIdCharacterEncoding()
{
return "UTF-8";
}
public static String bpmnProcessIdMetaAttribute(final MetaAttribute metaAttribute)
{
switch (metaAttribute)
{
case EPOCH: return "unix";
case TIME_UNIT: return "nanosecond";
case SEMANTIC_TYPE: return "";
}
return "";
}
public static int bpmnProcessIdHeaderLength()
{
return 2;
}
public CreateWorkflowRequestEncoder putBpmnProcessId(final DirectBuffer src, final int srcOffset, final int length)
{
if (length > 65534)
{
throw new IllegalArgumentException("length > max value for type: " + length);
}
final int headerLength = 2;
final int limit = parentMessage.limit();
parentMessage.limit(limit + headerLength + length);
buffer.putShort(limit, (short)length, java.nio.ByteOrder.LITTLE_ENDIAN);
buffer.putBytes(limit + headerLength, src, srcOffset, length);
return this;
}
public CreateWorkflowRequestEncoder putBpmnProcessId(final byte[] src, final int srcOffset, final int length)
{
if (length > 65534)
{
throw new IllegalArgumentException("length > max value for type: " + length);
}
final int headerLength = 2;
final int limit = parentMessage.limit();
parentMessage.limit(limit + headerLength + length);
buffer.putShort(limit, (short)length, java.nio.ByteOrder.LITTLE_ENDIAN);
buffer.putBytes(limit + headerLength, src, srcOffset, length);
return this;
}
public CreateWorkflowRequestEncoder bpmnProcessId(final String value)
{
final byte[] bytes;
try
{
bytes = value.getBytes("UTF-8");
}
catch (final java.io.UnsupportedEncodingException ex)
{
throw new RuntimeException(ex);
}
final int length = bytes.length;
if (length > 65534)
{
throw new IllegalArgumentException("length > max value for type: " + length);
}
final int headerLength = 2;
final int limit = parentMessage.limit();
parentMessage.limit(limit + headerLength + length);
buffer.putShort(limit, (short)length, java.nio.ByteOrder.LITTLE_ENDIAN);
buffer.putBytes(limit + headerLength, bytes, 0, length);
return this;
}
public static int bpmnXmlId()
{
return 5;
}
public static String bpmnXmlCharacterEncoding()
{
return "UTF-8";
}
public static String bpmnXmlMetaAttribute(final MetaAttribute metaAttribute)
{
switch (metaAttribute)
{
case EPOCH: return "unix";
case TIME_UNIT: return "nanosecond";
case SEMANTIC_TYPE: return "";
}
return "";
}
public static int bpmnXmlHeaderLength()
{
return 2;
}
public CreateWorkflowRequestEncoder putBpmnXml(final DirectBuffer src, final int srcOffset, final int length)
{
if (length > 65534)
{
throw new IllegalArgumentException("length > max value for type: " + length);
}
final int headerLength = 2;
final int limit = parentMessage.limit();
parentMessage.limit(limit + headerLength + length);
buffer.putShort(limit, (short)length, java.nio.ByteOrder.LITTLE_ENDIAN);
buffer.putBytes(limit + headerLength, src, srcOffset, length);
return this;
}
public CreateWorkflowRequestEncoder putBpmnXml(final byte[] src, final int srcOffset, final int length)
{
if (length > 65534)
{
throw new IllegalArgumentException("length > max value for type: " + length);
}
final int headerLength = 2;
final int limit = parentMessage.limit();
parentMessage.limit(limit + headerLength + length);
buffer.putShort(limit, (short)length, java.nio.ByteOrder.LITTLE_ENDIAN);
buffer.putBytes(limit + headerLength, src, srcOffset, length);
return this;
}
public CreateWorkflowRequestEncoder bpmnXml(final String value)
{
final byte[] bytes;
try
{
bytes = value.getBytes("UTF-8");
}
catch (final java.io.UnsupportedEncodingException ex)
{
throw new RuntimeException(ex);
}
final int length = bytes.length;
if (length > 65534)
{
throw new IllegalArgumentException("length > max value for type: " + length);
}
final int headerLength = 2;
final int limit = parentMessage.limit();
parentMessage.limit(limit + headerLength + length);
buffer.putShort(limit, (short)length, java.nio.ByteOrder.LITTLE_ENDIAN);
buffer.putBytes(limit + headerLength, bytes, 0, length);
return this;
}
public String toString()
{
return appendTo(new StringBuilder(100)).toString();
}
public StringBuilder appendTo(final StringBuilder builder)
{
CreateWorkflowRequestDecoder writer = new CreateWorkflowRequestDecoder();
writer.wrap(buffer, offset, BLOCK_LENGTH, SCHEMA_VERSION);
return writer.appendTo(builder);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy