Class StringEnum
Represents an enumeration where the members are strings.
Inheritance
Implements
Inherited Members
Namespace: Okta.Sdk
Assembly: Okta.Sdk.dll
Syntax
public abstract class StringEnum : IComparable
Constructors
StringEnum(String)
Initializes a new instance of the StringEnum class given a string.
Declaration
public StringEnum(string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | The enumeration value. |
Properties
Value
Gets the value of this enumeration member.
Declaration
public string Value { get; }
Property Value
Type | Description |
---|---|
System.String | The enumeration value. |
Methods
CompareTo(Object)
Declaration
public int CompareTo(object other)
Parameters
Type | Name | Description |
---|---|---|
System.Object | other | The object to compare to. |
Returns
Type | Description |
---|---|
System.Int32 |
Create<T>(String)
Creates a new StringEnum with the specified value.
Declaration
public static T Create<T>(string item)
Parameters
Type | Name | Description |
---|---|---|
System.String | item | The enum value. |
Returns
Type | Description |
---|---|
T | The created StringEnum. |
Type Parameters
Name | Description |
---|---|
T | The StringEnum type. |
Remarks
Equivalent to calling new MyEnum(value)
if MyEnum
inherits from StringEnum.
Use new
unless you don't know the exact enum type at compile time.
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj |
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 |
Overrides
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String |
Overrides
Operators
Equality(StringEnum, StringEnum)
Compares two StringEnum instances for value equality, ignoring case.
Declaration
public static bool operator ==(StringEnum x, StringEnum y)
Parameters
Type | Name | Description |
---|---|---|
StringEnum | x | The left operand. |
StringEnum | y | The right operand. |
Returns
Type | Description |
---|---|
System.Boolean | true if the instances have equal values; false otherwise. |
Implicit(StringEnum to String)
Gets the System.String value of a StringEnum member.
Declaration
public static implicit operator string (StringEnum enum)
Parameters
Type | Name | Description |
---|---|---|
StringEnum | enum | The enumeration member. |
Returns
Type | Description |
---|---|
System.String | The string value. |
Inequality(StringEnum, StringEnum)
Compares two StringEnum instances for value inequality, ignoring case.
Declaration
public static bool operator !=(StringEnum x, StringEnum y)
Parameters
Type | Name | Description |
---|---|---|
StringEnum | x | The left operand. |
StringEnum | y | The right operand. |
Returns
Type | Description |
---|---|
System.Boolean | true if the instances do not have equal values; true otherwise. |