Class ProtoPreconditions
Helper methods for throwing exceptions when preconditions are not met.
Inheritance
System.Object
ProtoPreconditions
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Google.Protobuf
Assembly: Google.Protobuf.dll
Syntax
public static class ProtoPreconditions
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)
Throws an ArgumentNullException if the given value is null, otherwise return the value to the caller.
Declaration
public static T CheckNotNull<T>(T value, string name)
where T : class
Parameters
Type | Name | Description |
---|---|---|
T | value | |
System.String | name |
Returns
Type | Description |
---|---|
T |
Type Parameters
Name | Description |
---|---|
T |