@InterfaceAudience.Public @InterfaceStability.Stable public enum SchemaType extends Enum<SchemaType>
Ideally we should have just one single set of enum definitions for schema type. but we have 3 locations of defining schema types.
when you are adding a new schema type that whose schema info is required to be recorded in schema registry, add corresponding schema type into `pulsar-common/src/main/proto/PulsarApi.proto` and `pulsar-broker/src/main/proto/SchemaRegistryFormat.proto`.
| Enum Constant and Description |
|---|
AUTO
Deprecated.
|
AUTO_CONSUME
Auto Consume Type.
|
AUTO_PUBLISH
Auto Publish Type.
|
AVRO
Serialize and deserialize via avro.
|
BOOLEAN
boolean schema defined.
|
BYTES
A bytes array.
|
DATE
Date.
|
DOUBLE
A double number.
|
FLOAT
A float number.
|
INSTANT
Instant.
|
INT16
A 16-byte integer.
|
INT32
A 32-byte integer.
|
INT64
A 64-byte integer.
|
INT8
A 8-byte integer.
|
JSON
JSON object encoding and validation.
|
KEY_VALUE
A Schema that contains Key Schema and Value Schema.
|
LOCAL_DATE
LocalDate.
|
LOCAL_DATE_TIME
LocalDateTime.
|
LOCAL_TIME
LocalTime.
|
NONE
No schema defined.
|
PROTOBUF
Protobuf message encoding and decoding.
|
PROTOBUF_NATIVE
Protobuf native schema base on Descriptor.
|
STRING
Simple String encoding with UTF-8.
|
TIME
Time.
|
TIMESTAMP
Timestamp.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getValue() |
boolean |
isPrimitive() |
static boolean |
isPrimitiveType(SchemaType type) |
boolean |
isStruct() |
static boolean |
isStructType(SchemaType type) |
static SchemaType |
valueOf(int value) |
static SchemaType |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static SchemaType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final SchemaType NONE
public static final SchemaType STRING
public static final SchemaType JSON
public static final SchemaType PROTOBUF
public static final SchemaType AVRO
public static final SchemaType BOOLEAN
public static final SchemaType INT8
public static final SchemaType INT16
public static final SchemaType INT32
public static final SchemaType INT64
public static final SchemaType FLOAT
public static final SchemaType DOUBLE
public static final SchemaType DATE
public static final SchemaType TIME
public static final SchemaType TIMESTAMP
public static final SchemaType KEY_VALUE
public static final SchemaType INSTANT
public static final SchemaType LOCAL_DATE
public static final SchemaType LOCAL_TIME
public static final SchemaType LOCAL_DATE_TIME
public static final SchemaType PROTOBUF_NATIVE
public static final SchemaType BYTES
@Deprecated public static final SchemaType AUTO
public static final SchemaType AUTO_CONSUME
public static final SchemaType AUTO_PUBLISH
public static SchemaType[] values()
for (SchemaType c : SchemaType.values()) System.out.println(c);
public static SchemaType valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic int getValue()
public static SchemaType valueOf(int value)
public boolean isPrimitive()
public boolean isStruct()
public static boolean isPrimitiveType(SchemaType type)
public static boolean isStructType(SchemaType type)
Copyright © 2017–2021 Apache Software Foundation. All rights reserved.