LuciadCPillar C# 2026.1.02
Loading...
Searching...
No Matches
Luciad.Datamodels.DataObject Class Referencesealed

A DataObject is a self-contained value that holds the properties described by a DataType, addressed through DataPropertyPath. More...

Inheritance diagram for Luciad.Datamodels.DataObject:

Classes

class  Builder
 Allows the incremental creation of a DataObject. More...

Public Member Functions

Luciad.Datamodels.DataObject.Builder AsBuilder ()
 Returns this DataObject as a Builder, making it possible to copy and modify its values.
void Dispose ()
override bool Equals (object other)
 Returns whether this DataObject and the given DataObject are the same instance.
override int GetHashCode ()
uint? GetListSize (Luciad.Datamodels.DataPropertyPath propertyPath)
 Returns the element count of a list-typed property.
uint? GetListSize (string propertyName)
 Convenience overload of getListSize that resolves the property by name on this data object's data type.
T GetValue< T > (Luciad.Datamodels.DataPropertyPath propertyPath)
 Accesses the value for the given property.
T GetValue< T > (string propertyName)
 Convenience overload of getValue that resolves the property by name on this data object's data type.

Static Public Member Functions

static Luciad.Datamodels.DataObject.Builder NewBuilder ()
 Returns a new DataObject Builder.

Properties

Luciad.Datamodels.DataType DataType [get]
 The data type describing this DataObject's properties.

Detailed Description

A DataObject is a self-contained value that holds the properties described by a DataType, addressed through DataPropertyPath.

DataObjects are immutable and thread-safe for reading. Use DataObject.Builder to create or modify one.

Since
2026.1

Member Function Documentation

◆ AsBuilder()

Luciad.Datamodels.DataObject.Builder Luciad.Datamodels.DataObject.AsBuilder ( )
inline

Returns this DataObject as a Builder, making it possible to copy and modify its values.

The data type cannot be changed through the returned builder.

Returns
this DataObject as a Builder.

◆ Dispose()

void Luciad.Datamodels.DataObject.Dispose ( )
inline

◆ Equals()

override bool Luciad.Datamodels.DataObject.Equals ( object other)
inline

Returns whether this DataObject and the given DataObject are the same instance.

Equality is identity-based.

Parameters
otherthe DataObject to compare with.
Returns
whether this DataObject and the given DataObject are the same instance.

◆ GetHashCode()

override int Luciad.Datamodels.DataObject.GetHashCode ( )
inline

◆ GetListSize() [1/2]

uint? Luciad.Datamodels.DataObject.GetListSize ( Luciad.Datamodels.DataPropertyPath propertyPath)
inline

Returns the element count of a list-typed property.

Parameters
propertyPaththe path to the list-typed property.
Returns
no value if the list is unset, or the element count otherwise (0 for an empty list).
Exceptions
System.ArgumentExceptionif the path's origin type does not match, or the path does not point to a list.

◆ GetListSize() [2/2]

uint? Luciad.Datamodels.DataObject.GetListSize ( string propertyName)
inline

Convenience overload of getListSize that resolves the property by name on this data object's data type.

Equivalent to calling getListSize with a DataPropertyPath built from getDataType() and propertyName.

Performance note: this overload resolves the name on every call. To read the same property from many data objects in a tight loop, build a DataPropertyPath once and use the DataPropertyPath overload, which prevents the repeated lookup.

Parameters
propertyNamethe name of a list-typed property in this data object's data type.
Returns
no value if the list is unset, or the element count otherwise (0 for an empty list).
Exceptions
System.ArgumentExceptionwhen no property with that name exists, or it does not point to a list.
Since
2026.1

◆ GetValue< T >() [1/2]

T Luciad.Datamodels.DataObject.GetValue< T > ( Luciad.Datamodels.DataPropertyPath propertyPath)
inline

Accesses the value for the given property.

The type parameter T depends on the type of value this property contains:

  • Scalar property: T is the element type (bool, int32_t, int64_t, float, double, std.string, or a Geometry, or one of its subtypes).
  • Composite property (value type is a non-primitive DataType): T is DataObject, and the nested composite value is returned.
  • List property: T is the list type, and the list is returned, or no value when the list is unset.
  • List element: T is the element type (DataObject for a composite element), and the single element is returned.
Parameters
propertyPaththe property for which to return a value.
Template Parameters
Tthe value type, chosen by property shape (see above).
Returns
the value, or no value if the property exists but is unset.
Exceptions
System.ArgumentExceptionwhen the path does not match this DataObject's data type, T does not match the path's leaf type, or the list is unset or the index is out-of-bounds for an indexed path.

◆ GetValue< T >() [2/2]

T Luciad.Datamodels.DataObject.GetValue< T > ( string propertyName)
inline

Convenience overload of getValue that resolves the property by name on this data object's data type.

Equivalent to calling getValue with a DataPropertyPath built from getDataType() and propertyName.

Performance note: this overload resolves the name on every call. To read the same property from many data objects in a tight loop, build a DataPropertyPath once and use the DataPropertyPath overload, which prevents the repeated lookup.

Parameters
propertyNamethe name of a property in this data object's data type.
Template Parameters
Tthe value type, chosen by the property's shape (see the DataPropertyPath overload).
Returns
the value, or no value if the property exists but is not set.
Exceptions
System.ArgumentExceptionwhen no property with that name exists, or T does not match its type.
Since
2026.1

◆ NewBuilder()

Luciad.Datamodels.DataObject.Builder Luciad.Datamodels.DataObject.NewBuilder ( )
inlinestatic

Returns a new DataObject Builder.

Returns
a new DataObject Builder.

Property Documentation

◆ DataType

Luciad.Datamodels.DataType Luciad.Datamodels.DataObject.DataType
get

The data type describing this DataObject's properties.

[get]

Returns the data type describing this DataObject's properties.