Package org.apache.pulsar.common.schema
Enum Class SchemaType
- All Implemented Interfaces:
Serializable
,Comparable<SchemaType>
,Constable
Types of supported schema for Pulsar messages.
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`.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionDeprecated.Auto Consume Type.Auto Publish Type.Serialize and deserialize via avro.boolean schema defined.A bytes array.Date.A double number.A float number.Instant.A 16-byte integer.A 32-byte integer.A 64-byte integer.A 8-byte integer.JSON object encoding and validation.A Schema that contains Key Schema and Value Schema.LocalDate.LocalDateTime.LocalTime.No schema defined.Protobuf message encoding and decoding.Protobuf native schema base on Descriptor.Simple String encoding with UTF-8.Time.Timestamp. -
Method Summary
Modifier and TypeMethodDescriptionint
getValue()
boolean
static boolean
isPrimitiveType
(SchemaType type) boolean
isStruct()
static boolean
isStructType
(SchemaType type) static SchemaType
valueOf
(int value) Returns the enum constant of this class with the specified name.static SchemaType
Returns the enum constant of this class with the specified name.static SchemaType[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NONE
No schema defined. -
STRING
Simple String encoding with UTF-8. -
JSON
JSON object encoding and validation. -
PROTOBUF
Protobuf message encoding and decoding. -
AVRO
Serialize and deserialize via avro. -
BOOLEAN
boolean schema defined.- Since:
- 2.3.0
-
INT8
A 8-byte integer. -
INT16
A 16-byte integer. -
INT32
A 32-byte integer. -
INT64
A 64-byte integer. -
FLOAT
A float number. -
DOUBLE
A double number. -
DATE
Date.- Since:
- 2.4.0
-
TIME
Time.- Since:
- 2.4.0
-
TIMESTAMP
Timestamp.- Since:
- 2.4.0
-
KEY_VALUE
A Schema that contains Key Schema and Value Schema. -
INSTANT
Instant. -
LOCAL_DATE
LocalDate. -
LOCAL_TIME
LocalTime. -
LOCAL_DATE_TIME
LocalDateTime. -
PROTOBUF_NATIVE
Protobuf native schema base on Descriptor. -
BYTES
A bytes array. -
AUTO
Deprecated.Auto Detect Schema Type. -
AUTO_CONSUME
Auto Consume Type. -
AUTO_PUBLISH
Auto Publish Type.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
getValue
public int getValue() -
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
value
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
isPrimitive
public boolean isPrimitive() -
isStruct
public boolean isStruct() -
isPrimitiveType
-
isStructType
-