Class ProtoPreconditions (3.15.8)

public static class ProtoPreconditions : object

Helper methods for throwing exceptions when preconditions are not met.

Inheritance

Object > ProtoPreconditions

Namespace

Google.Protobuf

Assembly

Google.Protobuf.dll

Remarks

This class is used internally and by generated code; it is not particularly expected to be used from application code, although nothing prevents it from being used that way.

Methods

CheckNotNull<T>(T, String)

public static T CheckNotNull<T>(T value, string name)
    where T : class

Throws an ArgumentNullException if the given value is null, otherwise return the value to the caller.

Parameters
NameDescription
valueT
nameString
Returns
TypeDescription
T
Type Parameter
NameDescription
T