Class MetadataValue
A class that represents a metadata value.
Inherited Members
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 |
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 |
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 |
AsTimestamp()
Returns the value as a DateTimeMetadata.
Declaration
public DateTimeMetadata AsTimestamp()
Returns
Type | Description |
---|---|
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 |