类 AbstractSchema<T>

java.lang.Object
org.apache.pulsar.client.impl.schema.AbstractSchema<T>
所有已实现的接口:
Cloneable, Schema<T>
直接已知子类:
AbstractStructSchema, BooleanSchema, ByteBufferSchema, ByteBufSchema, ByteSchema, BytesSchema, DateSchema, DoubleSchema, FloatSchema, InstantSchema, IntSchema, KeyValueSchemaImpl, LocalDateSchema, LocalDateTimeSchema, LocalTimeSchema, LongSchema, ShortSchema, StringSchema, TimeSchema, TimestampSchema

public abstract class AbstractSchema<T> extends Object implements Schema<T>
  • 构造器详细资料

    • AbstractSchema

      public AbstractSchema()
  • 方法详细资料

    • decode

      public abstract T decode(io.netty.buffer.ByteBuf byteBuf)
      Decode a byteBuf into an object using the schema definition and deserializer implementation

      Do not modify reader/writer index of ByteBuf so, it can be reused to access correct data.

      参数:
      byteBuf - the byte buffer to decode
      返回:
      the deserialized object
    • decode

      public T decode(io.netty.buffer.ByteBuf byteBuf, byte[] schemaVersion)
      Decode a byteBuf into an object using a given version.
      参数:
      byteBuf - the byte array to decode
      schemaVersion - the schema version to decode the object. null indicates using latest version.
      返回:
      the deserialized object
    • clone

      public Schema<T> clone()
      指定者:
      clone 在接口中 Schema<T>
      覆盖:
      clone 在类中 Object
    • atSchemaVersion

      public Schema<?> atSchemaVersion(byte[] schemaVersion) throws SchemaSerializationException
      Return an instance of this schema at the given version.
      参数:
      schemaVersion - the version
      返回:
      the schema at that specific version
      抛出:
      SchemaSerializationException - in case of unknown schema version
      NullPointerException - in case of null schemaVersion and supportSchemaVersioning is true