Show / Hide Table of Contents

Class Objects

Utility methods related to general objects in .NET.

Inheritance
System.Object
Objects
Namespace: EasyPost.Utilities.Internal
Assembly: EasyPost.dll
Syntax
public static class Objects : object

Methods

| Improve this Doc View Source

IsEnum(Nullable<Object>)

Check if an object is an Enum or derived from Enum.

Declaration
public static bool IsEnum(object? obj)
Parameters
Type Name Description
System.Nullable<System.Object> obj

The object to evaluate.

Returns
Type Description
System.Boolean

true if the object is an Enum or derived from Enum, false otherwise.

| Improve this Doc View Source

IsPrimitive(Nullable<Object>)

Check if an object is a primitive type (e.g. boolean, integer, string) or null.

Declaration
public static bool IsPrimitive(object? obj)
Parameters
Type Name Description
System.Nullable<System.Object> obj

The object to evaluate.

Returns
Type Description
System.Boolean

true if the object is a primitive type or null, false otherwise.

| Improve this Doc View Source

IsPropertySet(Object, String)

Check if a property of a specific object exists and is not null.

Declaration
public static bool IsPropertySet(object obj, string propertyName)
Parameters
Type Name Description
System.Object obj

The object to check properties of.

System.String propertyName

The name of the property to search for and evaluate.

Returns
Type Description
System.Boolean

true if the property exists on the object and is not null, false otherwise.

| Improve this Doc View Source

IsValueEnum(Nullable<Object>)

Check if an object is a ValueEnum or derived from ValueEnum.

Declaration
public static bool IsValueEnum(object? obj)
Parameters
Type Name Description
System.Nullable<System.Object> obj

The object to evaluate.

Returns
Type Description
System.Boolean

true if the object is a ValueEnum or derived from ValueEnum, false otherwise.

  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX