Class StringOr<T>
Holds either a single string or an object of type T without boxing.
Assembly: Glitch9.IO.dll
Syntax
public class StringOr<T> : INullable
Type Parameters
Constructors
|
Edit this page
View Source
StringOr(string)
Declaration
public StringOr(string stringValue)
Parameters
| Type |
Name |
Description |
| string |
stringValue |
|
|
Edit this page
View Source
StringOr(T)
Declaration
public StringOr(T objectValue)
Parameters
| Type |
Name |
Description |
| T |
objectValue |
|
Properties
|
Edit this page
View Source
HasValue
Gets whether this object has a value.
Declaration
public bool HasValue { get; }
Property Value
|
Edit this page
View Source
IsObject
Declaration
public bool IsObject { get; }
Property Value
|
Edit this page
View Source
IsString
Declaration
public bool IsString { get; }
Property Value
|
Edit this page
View Source
Length
If string ??its length. If object implements IEnumerable ??element count. Otherwise 0.
Declaration
public int Length { get; }
Property Value
|
Edit this page
View Source
ObjectValue
Declaration
public T ObjectValue { get; }
Property Value
|
Edit this page
View Source
StringValue
Declaration
public string StringValue { get; }
Property Value
Methods
|
Edit this page
View Source
ToObject()
Declaration
Returns
|
Edit this page
View Source
ToString()
Declaration
public override string ToString()
Returns
Overrides
Operators
|
Edit this page
View Source
implicit operator StringOr<T>(string)
Declaration
public static implicit operator StringOr<T>(string stringValue)
Parameters
| Type |
Name |
Description |
| string |
stringValue |
|
Returns
|
Edit this page
View Source
implicit operator StringOr<T>(T)
Declaration
public static implicit operator StringOr<T>(T objectValue)
Parameters
| Type |
Name |
Description |
| T |
objectValue |
|
Returns
Implements
Extension Methods