Class Empty (3.23.0)

public sealed class Empty : IMessage<Empty>, IEquatable<Empty>, IDeepCloneable<Empty>, IBufferMessage, IMessage

A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance:

service Foo {
  rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
}

Inheritance

object > Empty

Namespace

Google.Protobuf.WellKnownTypes

Assembly

Google.Protobuf.dll

Constructors

Empty()

public Empty()

Empty(Empty)

public Empty(Empty other)
Parameter
NameDescription
otherEmpty

Properties

Descriptor

public static MessageDescriptor Descriptor { get; }
Property Value
TypeDescription
MessageDescriptor

Parser

public static MessageParser<Empty> Parser { get; }
Property Value
TypeDescription
MessageParserEmpty

Methods

CalculateSize()

public int CalculateSize()

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

Returns
TypeDescription
int

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

Clone()

public Empty Clone()

Creates a deep clone of this object.

Returns
TypeDescription
Empty

A deep clone of this object.

Equals(Empty)

public bool Equals(Empty other)
Parameter
NameDescription
otherEmpty
Returns
TypeDescription
bool

Equals(object)

public override bool Equals(object other)
Parameter
NameDescription
otherobject
Returns
TypeDescription
bool
Overrides

GetHashCode()

public override int GetHashCode()
Returns
TypeDescription
int
Overrides

MergeFrom(CodedInputStream)

public void MergeFrom(CodedInputStream input)

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

Parameter
NameDescription
inputCodedInputStream
Remarks

See the user guide for precise merge semantics.

MergeFrom(Empty)

public void MergeFrom(Empty other)

Merges the given message into this one.

Parameter
NameDescription
otherEmpty
Remarks

See the user guide for precise merge semantics.

ToString()

public override string ToString()
Returns
TypeDescription
string
Overrides

WriteTo(CodedOutputStream)

public void WriteTo(CodedOutputStream output)

Writes the data to the given coded output stream.

Parameter
NameDescription
outputCodedOutputStream

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

Extension Methods