Class Enum
A Java-like enum implementation for C#.
Implements
Namespace: EasyPost.Utilities.Internal
Assembly: EasyPost.dll
Syntax
public abstract class Enum : IComparable, IEnum
Constructors
| Improve this Doc View SourceEnum(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 SourceCompareTo(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 |
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 |
GetAll<T>()
Retrieve an T.
Declaration
public static IEnumerable<T> GetAll<T>()
where T : IEnum
Returns
| Type | Description |
|---|---|
| IEnumerable<T> | An |
Type Parameters
| Name | Description |
|---|---|
| T | The type of Enum to retrieve all entries of. |
GetHashCode()
A Java-like enum implementation for C#.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| System.Int32 |
ToString()
A Java-like enum implementation for C#.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| System.String |
Operators
| Improve this Doc View SourceEquality(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 |
|
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 |
|
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 |
|
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 |
|
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 |
|
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 |
|