Struct SerializableOptional<T>
Represents Nullable<T> for simple value types.
Implements
Inherited Members
Namespace: AppstockSDK.Api
Assembly: Appstock.Core.dll
Syntax
[Serializable]
public struct SerializableOptional<T> : IEquatable<SerializableOptional<T>> where T : struct
Type Parameters
| Name | Description |
|---|---|
| T | Type of potentially contained value. |
Remarks
Custom property drawer included.
Fields
enabled
Gets or sets if value is present.
Declaration
public bool enabled
Field Value
| Type | Description |
|---|---|
| bool |
|
value
Gets or sets value of internal container.
Declaration
public T value
Field Value
| Type | Description |
|---|---|
| T | Value container for when enabled is |
Remarks
Ignored if enabled is false.
Methods
Equals(SerializableOptional<T>)
Indicates whether the current object is equal to another object of the same type.
Declaration
public readonly bool Equals(SerializableOptional<T> other)
Parameters
| Type | Name | Description |
|---|---|---|
| SerializableOptional<T> | other | An object to compare with this object. |
Returns
| Type | Description |
|---|---|
| bool | true if the current object is equal to the |
Equals(object?)
Indicates whether this instance and a specified object are equal.
Declaration
public override readonly bool Equals(object? obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj | The object to compare with the current instance. |
Returns
| Type | Description |
|---|---|
| bool | true if |
Overrides
GetHashCode()
Returns the hash code for this instance.
Declaration
public override readonly int GetHashCode()
Returns
| Type | Description |
|---|---|
| int | A 32-bit signed integer that is the hash code for this instance. |
Overrides
Operators
explicit operator T?(SerializableOptional<T>)
Converts SerializableOptional<T> to a Nullable<T>.
Declaration
public static explicit operator T?(SerializableOptional<T> optional)
Parameters
| Type | Name | Description |
|---|---|---|
| SerializableOptional<T> | optional | The SerializableOptional<T> to convert. |
Returns
| Type | Description |
|---|---|
| T? | The converted Nullable<T>. |
implicit operator SerializableOptional<T>(T?)
Converts Nullable<T> to a SerializableOptional<T>.
Declaration
public static implicit operator SerializableOptional<T>(T? nullableValue)
Parameters
| Type | Name | Description |
|---|---|---|
| T? | nullableValue | The Nullable<T> to convert. |
Returns
| Type | Description |
|---|---|
| SerializableOptional<T> | The converted SerializableOptional<T>. |