Show / Hide Table of Contents

Class Enum

A Java-like enum implementation for C#.

Inheritance
System.Object
Enum
ValueEnum
Implements
IEnum
Namespace: EasyPost.Utilities.Internal
Assembly: EasyPost.dll
Syntax
public abstract class Enum : IComparable, IEnum

Constructors

| Improve this Doc View Source

Enum(Int32)

Initializes a new instance of the Enum class.

Declaration
protected Enum(int id)
Parameters
Type Name Description
System.Int32 id

The internal ID to associated with this enum.

Methods

| Improve this Doc View Source

CompareTo(Nullable<Object>)

A Java-like enum implementation for C#.

Declaration
public int CompareTo(object? obj)
Parameters
Type Name Description
System.Nullable<System.Object> obj
Returns
Type Description
System.Int32
| Improve this Doc View Source

Equals(Nullable<Object>)

A Java-like enum implementation for C#.

Declaration
public override bool Equals(object? obj)
Parameters
Type Name Description
System.Nullable<System.Object> obj
Returns
Type Description
System.Boolean
| Improve this Doc View Source

GetAll<T>()

Retrieve an of all Enums of type T.

Declaration
public static IEnumerable<T> GetAll<T>()
    where T : IEnum
Returns
Type Description
IEnumerable<T>

An of all Enum of type T.

Type Parameters
Name Description
T

The type of Enum to retrieve all entries of.

| Improve this Doc View Source

GetHashCode()

A Java-like enum implementation for C#.

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32
| Improve this Doc View Source

ToString()

A Java-like enum implementation for C#.

Declaration
public override string ToString()
Returns
Type Description
System.String

Operators

| Improve this Doc View Source

Equality(Enum, Enum)

Compare two objects for equality.

Declaration
public static bool operator ==(Enum one, Enum two)
Parameters
Type Name Description
Enum one

The first object in the comparison.

Enum two

The second object in the comparison.

Returns
Type Description
System.Boolean

true if the two objects are equal; otherwise, false.

| Improve this Doc View Source

GreaterThan(Enum, Enum)

Compare two objects.

Declaration
public static bool operator>(Enum left, Enum right)
Parameters
Type Name Description
Enum left

The first object in the comparison.

Enum right

The second object in the comparison.

Returns
Type Description
System.Boolean

true if the left object is greater than the right object, false otherwise.

| Improve this Doc View Source

GreaterThanOrEqual(Enum, Enum)

Compare two objects.

Declaration
public static bool operator >=(Enum left, Enum right)
Parameters
Type Name Description
Enum left

The first object in the comparison.

Enum right

The second object in the comparison.

Returns
Type Description
System.Boolean

true if the left object is greater than or equal to the right object, false otherwise.

| Improve this Doc View Source

Inequality(Enum, Enum)

Compare two objects for inequality.

Declaration
public static bool operator !=(Enum one, Enum two)
Parameters
Type Name Description
Enum one

The first object in the comparison.

Enum two

The second object in the comparison.

Returns
Type Description
System.Boolean

true if the two objects are not equal; otherwise, false.

| Improve this Doc View Source

LessThan(Enum, Enum)

Compare two objects.

Declaration
public static bool operator <(Enum left, Enum right)
Parameters
Type Name Description
Enum left

The first object in the comparison.

Enum right

The second object in the comparison.

Returns
Type Description
System.Boolean

true if the left object is less than the right object, false otherwise.

| Improve this Doc View Source

LessThanOrEqual(Enum, Enum)

Compare two objects.

Declaration
public static bool operator <=(Enum left, Enum right)
Parameters
Type Name Description
Enum left

The first object in the comparison.

Enum right

The second object in the comparison.

Returns
Type Description
System.Boolean

true if the left object is less than or equal to the right object, false otherwise.

Implements

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