Class UdtSerializer
Represents a TypeSerializer<T> instance that handles UDT serialization and deserialization.
Inherited Members
Namespace: Cassandra.Serialization
Assembly: Cassandra.dll
Syntax
public class UdtSerializer : TypeSerializer<object>
Constructors
UdtSerializer()
Declaration
protected UdtSerializer()
Properties
CqlType
Returns the Cassandra data type for the serializer.
Declaration
public override ColumnTypeCode CqlType { get; }
Property Value
Type | Description |
---|---|
ColumnTypeCode |
Overrides
Methods
Deserialize(ushort, byte[], int, int, IColumnInfo)
When overridden from a derived class, it reads the byte buffer and returns the CLR representation of the data type.
Declaration
public override object Deserialize(ushort protocolVersion, byte[] buffer, int offset, int length, IColumnInfo typeInfo)
Parameters
Type | Name | Description |
---|---|---|
ushort | protocolVersion | The Cassandra native protocol version. |
byte[] | buffer | The byte array. |
int | offset | The zero-based byte offset in buffer at which to begin storing data from the current stream. |
int | length | The maximum amount of bytes to read from buffer. |
IColumnInfo | typeInfo | Additional type information designed for non-primitive types. |
Returns
Type | Description |
---|---|
object |
Overrides
GetClrType(IColumnInfo)
Declaration
protected virtual Type GetClrType(IColumnInfo typeInfo)
Parameters
Type | Name | Description |
---|---|---|
IColumnInfo | typeInfo |
Returns
Type | Description |
---|---|
Type |
GetUdtMap(string)
Declaration
protected virtual UdtMap GetUdtMap(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name |
Returns
Type | Description |
---|---|
UdtMap |
GetUdtMap(Type)
Declaration
protected virtual UdtMap GetUdtMap(Type type)
Parameters
Type | Name | Description |
---|---|---|
Type | type |
Returns
Type | Description |
---|---|
UdtMap |
Serialize(ushort, object)
When overridden from a derived class, it encodes the CLR object into the byte representation according to the Cassandra native protocol.
Declaration
public override byte[] Serialize(ushort protocolVersion, object value)
Parameters
Type | Name | Description |
---|---|---|
ushort | protocolVersion | The Cassandra native protocol version. |
object | value | The object to encode. |
Returns
Type | Description |
---|---|
byte[] |
Overrides
SetUdtMap(string, UdtMap)
Sets a Udt map for a given Udt name
Declaration
public virtual void SetUdtMap(string name, UdtMap map)
Parameters
Type | Name | Description |
---|---|---|
string | name | Fully qualified udt name case sensitive (keyspace.udtName) |
UdtMap | map |