docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class MetadataValue

    A class that represents a metadata value.

    Inheritance
    object
    MetadataValue
    BooleanMetadata
    DateTimeMetadata
    MultiSelectionMetadata
    NumberMetadata
    SingleSelectionMetadata
    StringMetadata
    UrlMetadata
    UserMetadata
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: Unity.Cloud.Assets
    Assembly: Unity.Cloud.Assets.dll
    Syntax
    public abstract class MetadataValue

    Properties

    ValueType

    Returns the type of the value.

    Declaration
    public MetadataValueType ValueType { get; }
    Property Value
    Type Description
    MetadataValueType

    Methods

    AsBoolean()

    Returns the value as a BooleanMetadata.

    Declaration
    public BooleanMetadata AsBoolean()
    Returns
    Type Description
    BooleanMetadata

    A BooleanMetadata.

    Exceptions
    Type Condition
    FormatException

    If the value is not parsable as a boolean.

    AsMultiSelection()

    Returns the value as a MultiSelectionMetadata object.

    Declaration
    public MultiSelectionMetadata AsMultiSelection()
    Returns
    Type Description
    MultiSelectionMetadata

    A MultiSelectionMetadata object containing a list of selected values.

    Remarks

    Parses the value to an enumeration of strings. Can be used when the representing the value of a ISelectionFieldDefinition when Multiselection is True.

    AsNumber()

    Returns the value as a NumberMetadata.

    Declaration
    public NumberMetadata AsNumber()
    Returns
    Type Description
    NumberMetadata

    A NumberMetadata.

    Exceptions
    Type Condition
    FormatException

    If the value is not parsable as a number.

    AsSingleSelection()

    Returns the value as a SingleSelectionMetadata object.

    Declaration
    public SingleSelectionMetadata AsSingleSelection()
    Returns
    Type Description
    SingleSelectionMetadata

    A SingleSelectionMetadata object containing the selected value.

    Remarks

    Parses the value to a simple string. Can be used when the representing the value of a ISelectionFieldDefinition when Multiselection is False.

    AsText()

    Returns the value as a StringMetadata.

    Declaration
    public StringMetadata AsText()
    Returns
    Type Description
    StringMetadata

    A StringMetadata.

    AsTimestamp()

    Returns the value as a DateTimeMetadata.

    Declaration
    public DateTimeMetadata AsTimestamp()
    Returns
    Type Description
    DateTimeMetadata

    A DateTimeMetadata.

    Exceptions
    Type Condition
    FormatException

    If the value is not parsable as a datetime.

    AsUrl()

    Returns the value as a UrlMetadata object.

    Declaration
    public UrlMetadata AsUrl()
    Returns
    Type Description
    UrlMetadata

    A UrlMetadata object containg the url.

    Remarks

    Parses the value to a url. Can be used when the representing the value of a IFieldDefinition of type Url.

    Exceptions
    Type Condition
    FormatException

    If the value is not parsable as a url.

    AsUser()

    Returns the value as a UserMetadata.

    Declaration
    public UserMetadata AsUser()
    Returns
    Type Description
    UserMetadata

    A UserMetadata.

    Remarks

    Parses the value to a Unity.Cloud.Common.UserId. can be used when the representing the value of a IFieldDefinition of type User.

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    string
    Overrides
    object.ToString()
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)