aerogear-xamarin-sdk
AeroGear Xamarin SDK
AeroGear.Mobile.Core.Utils.SanityCheck Class Reference

Utility class to help with checking values More...

Static Public Member Functions

static T NonNull< T > (T value, string paramName)
 Checks that the passed in value is not null. If it is null, a ArgumentNullException is thrown with a message specifying that the parameter can't be null. More...
 
static string NonEmpty (string value, string paramName)
 Checks if the passed in value is an empty string. The string gets trimmed. If it is empty, an ArgumentException gets thrown with an appropriate error message. More...
 
static string NonEmpty (string value, String paramName, bool trim)
 Checks if the passed in value is an empty string. if trim is true, the string gets trimmed.If it is empty, an ArgumentException gets thrown with an appropriate error message. More...
 
static string NonEmpty (string value, string customMessage, params Object[] messageParams)
 Checks if the passed in value is an empty String. If it is empty an ArgumentException is thrown with the passed in custom message.The params are applied to the customMessage according to String.Format More...
 
static string NonEmpty (string value, bool trim, string customMessage, params Object[] messageParams)
 Checks if the passed in value is an empty String. If it is empty an ArgumentException is thrown with the passed in custom message. The params are applied to the customMessage according to String.Format More...
 

Detailed Description

Utility class to help with checking values

Member Function Documentation

◆ NonEmpty() [1/4]

static string AeroGear.Mobile.Core.Utils.SanityCheck.NonEmpty ( string  value,
string  paramName 
)
static

Checks if the passed in value is an empty string. The string gets trimmed. If it is empty, an ArgumentException gets thrown with an appropriate error message.

Returns
The received value.
Parameters
valueString to be checked.
paramNameParameter name to be used in the error message.

◆ NonEmpty() [2/4]

static string AeroGear.Mobile.Core.Utils.SanityCheck.NonEmpty ( string  value,
String  paramName,
bool  trim 
)
static

Checks if the passed in value is an empty string. if trim is true, the string gets trimmed.If it is empty, an ArgumentException gets thrown with an appropriate error message.

Returns
The received value.
Parameters
valueString to be checked.
paramNameParameter name to be used in the error message.
trimwhether the string must be trimmed or not.

◆ NonEmpty() [3/4]

static string AeroGear.Mobile.Core.Utils.SanityCheck.NonEmpty ( string  value,
string  customMessage,
params Object []  messageParams 
)
static

Checks if the passed in value is an empty String. If it is empty an ArgumentException is thrown with the passed in custom message.The params are applied to the customMessage according to String.Format

Returns
The received value.
Parameters
valueString to be checked.
customMessageCustom message to be put into the exception.
messageParamsParameters to be applied to the custom message.

◆ NonEmpty() [4/4]

static string AeroGear.Mobile.Core.Utils.SanityCheck.NonEmpty ( string  value,
bool  trim,
string  customMessage,
params Object []  messageParams 
)
static

Checks if the passed in value is an empty String. If it is empty an ArgumentException is thrown with the passed in custom message. The params are applied to the customMessage according to String.Format

Returns
The received value.
Parameters
valueString to be checked.
trimWhether the string must be trimmed or not.
customMessageCustom message to be put into the exception.
messageParamsParameters to be applied to the custom message.

◆ NonNull< T >()

static T AeroGear.Mobile.Core.Utils.SanityCheck.NonNull< T > ( value,
string  paramName 
)
static

Checks that the passed in value is not null. If it is null, a ArgumentNullException is thrown with a message specifying that the parameter can't be null.

Returns
The received value.
Parameters
valueString to be checked.
paramNameParameter name to be used in the error message.
Template Parameters
TThe 1st type parameter.

The documentation for this class was generated from the following file: