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
Name Description
other Empty

Properties

Descriptor

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

Parser

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

Methods

CalculateSize()

public int CalculateSize()

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

Returns
Type Description
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
Type Description
Empty

A deep clone of this object.

Equals(Empty)

public bool Equals(Empty other)
Parameter
Name Description
other Empty
Returns
Type Description
bool

Equals(object)

public override bool Equals(object other)
Parameter
Name Description
other object
Returns
Type Description
bool
Overrides

GetHashCode()

public override int GetHashCode()
Returns
Type Description
int
Overrides

MergeFrom(CodedInputStream)

public void MergeFrom(CodedInputStream input)

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

Parameter
Name Description
input CodedInputStream
Remarks

See the user guide for precise merge semantics.

MergeFrom(Empty)

public void MergeFrom(Empty other)

Merges the given message into this one.

Parameter
Name Description
other Empty
Remarks

See the user guide for precise merge semantics.

ToString()

public override string ToString()
Returns
Type Description
string
Overrides

WriteTo(CodedOutputStream)

public void WriteTo(CodedOutputStream output)

Writes the data to the given coded output stream.

Parameter
Name Description
output CodedOutputStream

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

Extension Methods