confluent-kafka-dotnet
Show / Hide Table of Contents

Class Variant

Inheritance
object
Variant
Implements
IMessage<Variant>
IEquatable<Variant>
IDeepCloneable<Variant>
IBufferMessage
IMessage
Inherited Members
object.Equals(object, object)
object.GetType()
object.ReferenceEquals(object, object)
Namespace: Confluent.SchemaRegistry.Serdes.Protobuf
Assembly: Confluent.SchemaRegistry.Serdes.Protobuf.dll
Syntax
public sealed class Variant : IMessage<Variant>, IEquatable<Variant>, IDeepCloneable<Variant>, IBufferMessage, IMessage

Constructors

Variant()

Declaration
public Variant()

Variant(Variant)

Declaration
public Variant(Variant other)
Parameters
Type Name Description
Variant other

Fields

MetadataFieldNumber

Field number for the "metadata" field.

Declaration
public const int MetadataFieldNumber = 1
Field Value
Type Description
int

ValueFieldNumber

Field number for the "value" field.

Declaration
public const int ValueFieldNumber = 2
Field Value
Type Description
int

Properties

Descriptor

Declaration
public static MessageDescriptor Descriptor { get; }
Property Value
Type Description
MessageDescriptor

Metadata

A dictionary of field names used by all objects in the variant value. Encoded as: version header, dictionary size, offset list, and UTF-8 string data.

Declaration
public ByteString Metadata { get; set; }
Property Value
Type Description
ByteString

Parser

Declaration
public static MessageParser<Variant> Parser { get; }
Property Value
Type Description
MessageParser<Variant>

Value

The variant value, which can be a primitive, object, or array. Encoded as: a one-byte header (basic type + type info) followed by the content bytes.

Declaration
public ByteString Value { get; set; }
Property Value
Type Description
ByteString

Methods

CalculateSize()

Calculates the size of this message in Protocol Buffer wire format, in bytes.

Declaration
public int CalculateSize()
Returns
Type Description
int

The number of bytes required to write this message to a coded output stream.

Clone()

Creates a deep clone of this object.

Declaration
public Variant Clone()
Returns
Type Description
Variant

A deep clone of this object.

Equals(Variant)

Indicates whether the current object is equal to another object of the same type.

Declaration
public bool Equals(Variant other)
Parameters
Type Name Description
Variant other

An object to compare with this object.

Returns
Type Description
bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object)

Determines whether the specified object is equal to the current object.

Declaration
public override bool Equals(object other)
Parameters
Type Name Description
object other
Returns
Type Description
bool

true if the specified object is equal to the current object; otherwise, false.

Overrides
object.Equals(object)

GetHashCode()

Serves as the default hash function.

Declaration
public override int GetHashCode()
Returns
Type Description
int

A hash code for the current object.

Overrides
object.GetHashCode()

MergeFrom(Variant)

Merges the given message into this one.

Declaration
public void MergeFrom(Variant other)
Parameters
Type Name Description
Variant other
Remarks

See the user guide for precise merge semantics.

MergeFrom(CodedInputStream)

Merges the data from the specified coded input stream with the current message.

Declaration
public void MergeFrom(CodedInputStream input)
Parameters
Type Name Description
CodedInputStream input
Remarks

See the user guide for precise merge semantics.

ToString()

Returns a string that represents the current object.

Declaration
public override string ToString()
Returns
Type Description
string

A string that represents the current object.

Overrides
object.ToString()

WriteTo(CodedOutputStream)

Writes the data to the given coded output stream.

Declaration
public void WriteTo(CodedOutputStream output)
Parameters
Type Name Description
CodedOutputStream output

Coded output stream to write the data to. Must not be null.

Implements

Google.Protobuf.IMessage<T>
IEquatable<T>
Google.Protobuf.IDeepCloneable<T>
Google.Protobuf.IBufferMessage
Google.Protobuf.IMessage
In this article