docs.unity3d.com
  • Manual
  • Scripting API
  • Changelog
  • License

    • Unity.DigitalTwins.Live.Sdk.Abstractions
      • AuthorizedMessagingClient
      • LiveMessagingClient
    • Unity.DigitalTwins.Live.Sdk.Implementations
      • MessagingClientWrapper
      • ServiceHttpClientWrapper
      • SignalBus
    • Unity.DigitalTwins.Live.Sdk.Interfaces
      • IMessagingClientWrapper
      • IServiceHttpClientWrapper
      • ISignalBus
    • Unity.DigitalTwins.Live.Sdk.Mappers
      • DeviceMapper
      • DeviceTelemetriesMapper
      • NotificationMapper
      • TelemetryAggregateMapper
      • TelemetryMapper
    • Unity.DigitalTwins.Live.Sdk.Mappers.Configurations.DeviceSummaries
      • DeviceSummaryMapper
    • Unity.DigitalTwins.Live.Sdk.Mappers.Configurations.Plots
      • AxisPropertiesMapper
      • PlotConfigurationMapper
      • SeriesPropertiesMapper
    • Unity.DigitalTwins.Live.Sdk.Mappers.Configurations.Plots.TimeSeries
      • TimeSeriesPlotConfigurationMapper
      • TimeSeriesPropertiesMapper
    • Unity.DigitalTwins.Live.Sdk.Mappers.DataAssociations
      • CustomPropertiesListMapper
      • CustomPropertiesMapper
      • DeviceListMapper
      • RuleInterpreterListMapper
      • RuleInterpreterMapper
      • RuleListMapper
      • RuleMapper
    • Unity.DigitalTwins.Live.Sdk.Models
      • Device
      • DeviceTelemetries
      • FacilityInfo
      • LiveDevice
      • Notification
      • PulsingMaterialData
      • PulsingState
      • Telemetry
      • TelemetryAggregate
      • TelemetryHistory
    • Unity.DigitalTwins.Live.Sdk.Models.Configurations.DeviceSummaries
      • DeviceSummary
    • Unity.DigitalTwins.Live.Sdk.Models.Configurations.Plots
      • AxisProperties
      • PlotConfiguration
      • SeriesProperties
    • Unity.DigitalTwins.Live.Sdk.Models.Configurations.Plots.TimeSeries
      • TimeSeriesPlotConfiguration
      • TimeSeriesProperties
    • Unity.DigitalTwins.Live.Sdk.Models.DataAssociations
      • CustomProperties
      • Rule
      • RuleInterpreter
    • Unity.DigitalTwins.Live.Sdk.Samples.Services
      • DebugSignalBus
    • Unity.DigitalTwins.Live.Sdk.Samples.Services.Controllers
      • ConfigurationController
      • DeviceController
      • FacilityController
      • LoginController
      • NotificationController
      • ServicesController
      • TelemetryHistoryController
    • Unity.DigitalTwins.Live.Sdk.Samples.Services.Editor
      • ConfigurationControllerEditor
      • DeviceControllerEditor
      • FacilityControllerEditor
      • NotificationControllerEditor
      • TelemetryHistoryControllerEditor
    • Unity.DigitalTwins.Live.Sdk.Samples.Services.Models
      • ConfigurationServiceResult
      • DeviceServiceResult
      • DeviceSummaryResult
      • FacilityServiceResult
      • LiveDeviceResultView
      • NotificationServiceResult
      • TelemetryHistoryServiceResult
    • Unity.DigitalTwins.Live.Sdk.Services.Implementations
      • ConfigurationService
      • DataAssociationsService
      • DeviceService
      • FacilityService
      • NotificationService
      • TelemetryHistoryService
    • Unity.DigitalTwins.Live.Sdk.Services.Interfaces
      • IConfigurationService
      • IDataAssociationsService
      • IDeviceService
      • IFacilityService
      • INotificationService
      • ITelemetryHistoryService
    • Unity.DigitalTwins.Live.Sdk.Settings
      • CameraSettings
      • EnvironmentSettings
      • NavigationSettings
    • Unity.DigitalTwins.Live.Sdk.Signals
      • CameraInteractionModeUpdatedSignal
      • CameraInteractionModeUpdatedSignal.CameraInteractionMode
      • CameraZoomedSignal
      • DataAssociatedSignal
      • DeviceTelemetriesReceivedSignal
      • HoverChangedSignal
      • LiveDevicesReceivedSignal
      • LiveDeviceUpdatedSignal
      • LoginStateChangedSignal
      • ModifySelectionRequestSignal
      • NavigationTargetUpdatedSignal
      • NotificationReceivedSignal
      • SelectionChangedSignal
      • SettingChangedSignal
      • TelemetryAggregateReceivedSignal
    • Unity.DigitalTwins.Live.Sdk.Tests.Editor
      • PlaceholderUnitTests
    • Unity.DigitalTwins.Live.Sdk.Tests.Editor.Utilities
      • ServicesTestFactory
      • TestFactory
    • Unity.DigitalTwins.Live.Sdk.Utilities
      • ClientUtility
      • Constants
      • DeviceTopic
      • Optional
      • Optional<T>

    Class Optional<T>

    Represents a specifically-typed resource that includes an 'Empty' state to discourage referencing a null value.

    Inheritance
    Object
    Optional
    Optional<T>
    Inherited Members
    Optional.m_Value
    Optional.m_IsEmpty
    Namespace: Unity.DigitalTwins.Live.Sdk.Utilities
    Assembly: solution.dll
    Syntax
    [Serializable]
    public class Optional<T> : Optional
    Type Parameters
    Name Description
    T

    The type of the contained value.

    Constructors

    Optional()

    Creates an instance of Optional in an Empty state with a default value.

    Declaration
    public Optional()

    Optional(T)

    Creates an instance of Optional and assigns the type

    value

    . Construction with a null

    value

    results in an 'Empty' state.

    Declaration
    public Optional(T value)
    Parameters
    Type Name Description
    T value

    The resource this class represents.

    Methods

    Equals(Object)

    Compares the contained value to another object.

    Declaration
    public override bool Equals(object other)
    Parameters
    Type Name Description
    Object other

    The object you want to compare to the contained value.

    Returns
    Type Description
    Boolean

    True if

    other

    is Optional and matches the contained value.

    Overrides
    Object.Equals(Object)

    Get()

    Retrieves the contained value.

    Declaration
    public T Get()
    Returns
    Type Description
    T

    The contained value.

    GetHashCode()

    Retrieves a hash code representing an Optional value.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    Int32

    A hash code made up of the contained value and its Empty state.

    Overrides
    Object.GetHashCode()

    GetOrDefault()

    Retrieves the contained value if it's assigned. Otherwise uses the default value.

    Declaration
    public T GetOrDefault()
    Returns
    Type Description
    T

    The contained value if it's not null. Otherwise returns the default value.

    GetOrElse(T)

    Retrieves the contained value if it's assigned. Otherwise uses the

    other

    value.

    Declaration
    public T GetOrElse(T other)
    Parameters
    Type Name Description
    T other

    The alternative value.

    Returns
    Type Description
    T

    The contained value if it's not default or null. Otherwise returns the

    other

    value.

    IsEmpty()

    Queries the state of the contained value.

    Declaration
    public bool IsEmpty()
    Returns
    Type Description
    Boolean

    True if the value is default or null.

    IsPresent()

    Queries the state of the contained value.

    Declaration
    public bool IsPresent()
    Returns
    Type Description
    Boolean

    True if the value in not default or null.

    ToString()

    Retrieves the contained value as a string.

    Declaration
    public override string ToString()
    Returns
    Type Description
    String

    The contained value as a string if it's not null. Otherwise returns an empty string.

    Overrides
    Object.ToString()
    Back to top Generated by DocFX
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023