The DeviceAtlas Carrier documentation
Public Member Functions | List of all members
Com.DeviceAtlas.Property Class Reference

Contains a property value. The value can be fetched as a generic Object or one of the convenience asXXXX methods can be used to get the value in a specific type. More...

Public Member Functions

 Property (object value, sbyte dataTypeId)
 Create a new Property with a value and data type. More...
 
 Property (object value, sbyte dataTypeId, bool isCollectionOfValues)
 Create a new Property with a value and data type. More...
 
virtual sbyte GetDataTypeId ()
 Get the data type ID for values associated with this Property More...
 
virtual string GetDataType ()
 Get the data type name for values associated with this Property More...
 
virtual object Value ()
 Get the value Object. This needs to be cast to the appropriate type such as Integer to be used. E.g. Integer value = (Integer)property.value(); More...
 
override string ToString ()
 Get the value of the property as a String. Alias for asString() . If a property has multiple possible values then the values are concatenated with a comma. More...
 
virtual string AsString ()
 Get the value of the property as a String. Alias for toString() . More...
 
virtual bool AsBoolean ()
 Get the value of the property as a boolean. More...
 
virtual int AsInteger ()
 Get the value of the property as an int. More...
 
virtual IList AsSet ()
 Gets a set of possible values for this property. This is typically only used when it is known that a given property name can have multiple possible values. All items in the set will have the same data tyoe. More...
 
override bool Equals (object obj)
 Check if another object is equal to this object. It must have the same interface, data type and value. More...
 
override int GetHashCode ()
 Get object hashcode More...
 

Detailed Description

Contains a property value. The value can be fetched as a generic Object or one of the convenience asXXXX methods can be used to get the value in a specific type.

Author
DeviceAtlas Limited

Constructor & Destructor Documentation

◆ Property() [1/2]

Com.DeviceAtlas.Property.Property ( object  value,
sbyte  dataTypeId 
)
inline

Create a new Property with a value and data type.

Parameters
valueThe value to store
dataTypeIdThe type of the value to store

◆ Property() [2/2]

Com.DeviceAtlas.Property.Property ( object  value,
sbyte  dataTypeId,
bool  isCollectionOfValues 
)
inline

Create a new Property with a value and data type.

Parameters
valueThe value to store
dataTypeIdThe type of the value to store
isCollectionOfValuesIndicates if the Property will contain a single value or multiple values

Member Function Documentation

◆ AsBoolean()

virtual bool Com.DeviceAtlas.Property.AsBoolean ( )
inlinevirtual

Get the value of the property as a boolean.

Returns
The boolean value of the property
Exceptions
IncorrectPropertyTypeExceptionThrown if the type of the value is not a DataType.BOOLEAN

◆ AsInteger()

virtual int Com.DeviceAtlas.Property.AsInteger ( )
inlinevirtual

Get the value of the property as an int.

Returns
The integer value of the property.
Exceptions
IncorrectPropertyTypeExceptionThrown if the type of the value is not compatible with a DataType.INTEGER

◆ AsSet()

virtual IList Com.DeviceAtlas.Property.AsSet ( )
inlinevirtual

Gets a set of possible values for this property. This is typically only used when it is known that a given property name can have multiple possible values. All items in the set will have the same data tyoe.

Returns
A set of values.

◆ AsString()

virtual string Com.DeviceAtlas.Property.AsString ( )
inlinevirtual

Get the value of the property as a String. Alias for toString() .

Returns
The String value of the property

◆ Equals()

override bool Com.DeviceAtlas.Property.Equals ( object  obj)
inline

Check if another object is equal to this object. It must have the same interface, data type and value.

Parameters
objobject to be compared against

◆ GetDataType()

virtual string Com.DeviceAtlas.Property.GetDataType ( )
inlinevirtual

Get the data type name for values associated with this Property

Returns
The name of the data type

◆ GetDataTypeId()

virtual sbyte Com.DeviceAtlas.Property.GetDataTypeId ( )
inlinevirtual

Get the data type ID for values associated with this Property

Returns
The ID of the data type

◆ GetHashCode()

override int Com.DeviceAtlas.Property.GetHashCode ( )
inline

Get object hashcode

◆ ToString()

override string Com.DeviceAtlas.Property.ToString ( )
inline

Get the value of the property as a String. Alias for asString() . If a property has multiple possible values then the values are concatenated with a comma.

Returns
The String value of the property

◆ Value()

virtual object Com.DeviceAtlas.Property.Value ( )
inlinevirtual

Get the value Object. This needs to be cast to the appropriate type such as Integer to be used. E.g. Integer value = (Integer)property.value();

Returns
The raw Object value.

The documentation for this class was generated from the following file: