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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003e\u003ccode\u003eProtoPreconditions\u003c/code\u003e is a static class within the \u003ccode\u003eGoogle.Protobuf\u003c/code\u003e namespace, offering helper methods for exception handling when preconditions fail.\u003c/p\u003e\n"],["\u003cp\u003eThe class is primarily intended for internal use and by generated code, although it can technically be used in application code.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eProtoPreconditions\u003c/code\u003e inherits from the base \u003ccode\u003eobject\u003c/code\u003e class, inheriting its standard methods, such as \u003ccode\u003eEquals\u003c/code\u003e, \u003ccode\u003eGetHashCode\u003c/code\u003e, and \u003ccode\u003eToString\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe class contains the \u003ccode\u003eCheckNotNull<T>(T value, string name)\u003c/code\u003e method, which verifies if a provided value is not null and throws an \u003ccode\u003eArgumentNullException\u003c/code\u003e if it is, returning the value otherwise.\u003c/p\u003e\n"],["\u003cp\u003eThere are multiple versions of \u003ccode\u003eProtoPreconditions\u003c/code\u003e, with version 3.27.1 being the latest release.\u003c/p\u003e\n"]]],[],null,[]]