Class StringOr<T>
- Namespace
- Glitch9.IO.Networking.RESTApi
This object can be either a string, T, or an array of T.
public class StringOr<T>
Type Parameters
TThe type of the object that can be stored in the StringOr.
- Inheritance
-
StringOr<T>
- Inherited Members
- Extension Methods
Constructors
StringOr(bool)
public StringOr(bool isArray = false)
Parameters
isArraybool
StringOr(IEnumerable)
public StringOr(IEnumerable arrayValue)
Parameters
arrayValueIEnumerable
StringOr(string)
public StringOr(string stringValue)
Parameters
stringValuestring
StringOr(T)
public StringOr(T objectValue)
Parameters
objectValueT
Fields
Value
public object Value
Field Value
Properties
HasValue
public bool HasValue { get; }
Property Value
IsArray
public bool IsArray { get; }
Property Value
IsObject
public bool IsObject { get; }
Property Value
IsString
public bool IsString { get; }
Property Value
Length
Returns the length of the array if the value is an array, returns the length of the string if the value is a string, otherwise returns 0.
public int Length { get; }
Property Value
Methods
Add(T)
public void Add(T value)
Parameters
valueT
ToArray()
public T[] ToArray()
Returns
- T[]
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.
Operators
implicit operator StringOr<T>(string)
public static implicit operator StringOr<T>(string stringValue)
Parameters
stringValuestring
Returns
- StringOr<T>
implicit operator StringOr<T>(T)
public static implicit operator StringOr<T>(T objectValue)
Parameters
objectValueT
Returns
- StringOr<T>
implicit operator StringOr<T>(T[])
public static implicit operator StringOr<T>(T[] arrayValue)
Parameters
arrayValueT[]
Returns
- StringOr<T>