public class ConnectEnum extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
LOGICAL_PARAMETER |
| Constructor and Description |
|---|
ConnectEnum() |
| Modifier and Type | Method and Description |
|---|---|
static org.apache.kafka.connect.data.SchemaBuilder |
builder(String annotation,
List<String> symbols)
Returns a SchemaBuilder for an Enum.
|
static org.apache.kafka.connect.data.SchemaBuilder |
builder(String annotation,
Map<String,Integer> symbols)
Returns a SchemaBuilder for an Enum.
|
static <T extends Enum<T>> |
fromLogical(org.apache.kafka.connect.data.Schema schema,
T value)
Convert a value from its logical format (Enum) to its encoded format.
|
static boolean |
hasEnumSymbol(org.apache.kafka.connect.data.Schema schema,
String symbol)
Returns whether a schema has an Enum symbol.
|
static boolean |
isEnum(org.apache.kafka.connect.data.Schema schema)
Returns whether a schema represents an Enum.
|
static <T extends Enum<T>> |
toLogical(org.apache.kafka.connect.data.Schema schema,
Class<T> cls,
String symbol)
Convert a value from its encoded format to its logical format (Enum).
|
static int |
toOrdinal(org.apache.kafka.connect.data.Schema schema,
String symbol)
Convert a value from its encoded format to its ordinal.
|
public static final String LOGICAL_PARAMETER
public static org.apache.kafka.connect.data.SchemaBuilder builder(String annotation, List<String> symbols)
annotation - an arbitrary annotation to be associated with the enumsymbols - the enum symbolspublic static org.apache.kafka.connect.data.SchemaBuilder builder(String annotation, Map<String,Integer> symbols)
annotation - an arbitrary annotation to be associated with the enumsymbols - a map of enum symbol to its ordinalpublic static boolean isEnum(org.apache.kafka.connect.data.Schema schema)
schema - the schemapublic static boolean hasEnumSymbol(org.apache.kafka.connect.data.Schema schema,
String symbol)
schema - the schemasymbol - the enum symbolpublic static <T extends Enum<T>> String fromLogical(org.apache.kafka.connect.data.Schema schema, T value)
schema - the schemavalue - the logical valuepublic static <T extends Enum<T>> T toLogical(org.apache.kafka.connect.data.Schema schema, Class<T> cls, String symbol)
schema - the schemacls - the class of the logical valuesymbol - the enum symbolpublic static int toOrdinal(org.apache.kafka.connect.data.Schema schema,
String symbol)
schema - the schemasymbol - the enum symbolCopyright © 2026 Confluent, Inc.. All rights reserved.