Skip to content

DiGi.Core.IO.Wrapper.Classes

github-actions[bot] edited this page Jul 15, 2026 · 2 revisions

DiGi.Core.IO.Wrapper.Classes Namespace

Classes

Wrapper Class

Base class for wrapping serializable objects into a structure that can be persisted and retrieved using unique references.

public abstract class Wrapper : System.IDisposable

Inheritance System.Object → Wrapper

Implements System.IDisposable

Constructors

Wrapper() Constructor

Initializes a new instance of the Wrapper class.

public Wrapper();

Methods

Wrapper.Add(ISerializableObject) Method

Adds a serializable object to the wrapper and returns its unique reference.

public DiGi.Core.Classes.UniqueReference? Add(DiGi.Core.Interfaces.ISerializableObject? value);

Parameters

value DiGi.Core.Interfaces.ISerializableObject

The serializable object to add.

Returns

DiGi.Core.Classes.UniqueReference
A DiGi.Core.Classes.UniqueReference for the added object, or null.

Wrapper.Add(double) Method

Adds a double value to the wrapper and returns its unique identifier reference.

public DiGi.Core.Classes.UniqueIdReference? Add(double value);

Parameters

value System.Double

The double value to add.

Returns

DiGi.Core.Classes.UniqueIdReference
A DiGi.Core.Classes.UniqueIdReference for the added value, or null.

Wrapper.Add(string) Method

Adds a string value to the wrapper and returns its unique identifier reference.

public DiGi.Core.Classes.UniqueIdReference? Add(string? value);

Parameters

value System.String

The string value to add.

Returns

DiGi.Core.Classes.UniqueIdReference
A DiGi.Core.Classes.UniqueIdReference for the added value, or null.

Wrapper.AddRange<TSerializableObject>(IEnumerable<TSerializableObject>) Method

Adds a collection of serializable objects to the wrapper and returns their unique references.

public System.Collections.Generic.List<DiGi.Core.Classes.UniqueReference>? AddRange<TSerializableObject>(System.Collections.Generic.IEnumerable<TSerializableObject>? serializableObjects)
    where TSerializableObject : DiGi.Core.Interfaces.ISerializableObject;

Type parameters

TSerializableObject

The type of serializable objects being added.

Parameters

serializableObjects System.Collections.Generic.IEnumerable<TSerializableObject>

The collection of serializable objects to add.

Returns

System.Collections.Generic.List<DiGi.Core.Classes.UniqueReference>
A list of DiGi.Core.Classes.UniqueReference for the added objects, or null.

Wrapper.Clear() Method

Clears the cached content of the file.

public void Clear();

Wrapper.Dispose() Method

Releases all resources used by the watcher.

public void Dispose();

Implements Dispose()

Wrapper.GetJsonNodes() Method

Parses and returns the file content as a list of JSON nodes.

public System.Collections.Generic.List<System.Text.Json.Nodes.JsonNode?>? GetJsonNodes();

Returns

System.Collections.Generic.List<System.Text.Json.Nodes.JsonNode>
A list of System.Text.Json.Nodes.JsonNode objects, or null if the operation fails.

Wrapper.GetMetadata<TMetadata>() Method

Retrieves metadata associated with the file.

public TMetadata? GetMetadata<TMetadata>()
    where TMetadata : DiGi.Core.IO.Interfaces.IMetadata;

Type parameters

TMetadata

The type of metadata to retrieve.

Returns

TMetadata
The metadata object of type TMetadata, or null if not found.

Wrapper.GetSerializableObjects() Method

Retrieves all serializable objects from the file content.

public System.Collections.Generic.List<DiGi.Core.Interfaces.ISerializableObject>? GetSerializableObjects();

Returns

System.Collections.Generic.List<DiGi.Core.Interfaces.ISerializableObject>
A list of objects implementing DiGi.Core.Interfaces.ISerializableObject, or null.

Wrapper.GetSerializableObjects<TSerializableObject>() Method

Retrieves all serializable objects of a specific type from the file content.

public System.Collections.Generic.List<TSerializableObject>? GetSerializableObjects<TSerializableObject>()
    where TSerializableObject : DiGi.Core.Interfaces.ISerializableObject;

Type parameters

TSerializableObject

The type of serializable objects to retrieve.

Returns

System.Collections.Generic.List<TSerializableObject>
A list of serializable objects of type TSerializableObject, or null.

Wrapper.Read() Method

Reads the file and returns its content as a list of JSON nodes.

public System.Collections.Generic.List<System.Text.Json.Nodes.JsonNode>? Read();

Returns

System.Collections.Generic.List<System.Text.Json.Nodes.JsonNode>
A list of System.Text.Json.Nodes.JsonNode objects representing the file content, or null.

Wrapper.Read(IEnumerable<UniqueReference>) Method

Reads JSON nodes associated with the provided unique references.

public System.Collections.Generic.List<System.Text.Json.Nodes.JsonNode>? Read(System.Collections.Generic.IEnumerable<DiGi.Core.Classes.UniqueReference>? uniqueReferences);

Parameters

uniqueReferences System.Collections.Generic.IEnumerable<DiGi.Core.Classes.UniqueReference>

The collection of unique references to read.

Returns

System.Collections.Generic.List<System.Text.Json.Nodes.JsonNode>
A list of JSON nodes corresponding to the provided references, or null.

Wrapper.Read<TSerializableObject>(UniqueReference) Method

Reads a single serializable object from the file using its unique reference.

public TSerializableObject? Read<TSerializableObject>(DiGi.Core.Classes.UniqueReference? uniqueReference)
    where TSerializableObject : DiGi.Core.Interfaces.ISerializableObject;

Type parameters

TSerializableObject

The type of the serializable object to read.

Parameters

uniqueReference DiGi.Core.Classes.UniqueReference

The unique reference of the object to read.

Returns

TSerializableObject
The deserialized object of type TSerializableObject, or null.

Wrapper.Read<TSerializableObject>(IEnumerable<UniqueReference>) Method

Reads specific serializable objects from the file based on the provided references.

public System.Collections.Generic.List<TSerializableObject>? Read<TSerializableObject>(System.Collections.Generic.IEnumerable<DiGi.Core.Classes.UniqueReference> uniqueReferences)
    where TSerializableObject : DiGi.Core.Interfaces.ISerializableObject;

Type parameters

TSerializableObject

The type of serializable objects to read.

Parameters

uniqueReferences System.Collections.Generic.IEnumerable<DiGi.Core.Classes.UniqueReference>

A collection of unique references used to identify the objects to be read.

Returns

System.Collections.Generic.List<TSerializableObject>
A list of serializable objects of type TSerializableObject, or null if no objects were found.

Wrapper.SetMetadata(IMetadata) Method

Sets the metadata for the file content.

public void SetMetadata(DiGi.Core.IO.Interfaces.IMetadata metadata);

Parameters

metadata DiGi.Core.IO.Interfaces.IMetadata

The metadata to set.

Wrapper.Write() Method

Writes all current objects to the file.

public System.Collections.Generic.IEnumerable<DiGi.Core.Classes.UniqueReference>? Write();

Returns

System.Collections.Generic.IEnumerable<DiGi.Core.Classes.UniqueReference>
A collection of unique references for the written objects, or null.

Wrapper.Write(IEnumerable<UniqueReference>) Method

Writes specific objects to the file based on the provided references.

public System.Collections.Generic.IEnumerable<DiGi.Core.Classes.UniqueReference>? Write(System.Collections.Generic.IEnumerable<DiGi.Core.Classes.UniqueReference>? uniqueReferences);

Parameters

uniqueReferences System.Collections.Generic.IEnumerable<DiGi.Core.Classes.UniqueReference>

The collection of unique references to write.

Returns

System.Collections.Generic.IEnumerable<DiGi.Core.Classes.UniqueReference>
A collection of unique references for the written objects, or null.

WrapperItem Class

Represents a wrapper item containing a unique reference and associated data.

public sealed class WrapperItem : DiGi.Core.IO.Wrapper.Interfaces.IWrapperObject, DiGi.Core.IO.Interfaces.IIOObject, DiGi.Core.Interfaces.IObject

Inheritance System.Object → WrapperItem

Implements DiGi.Core.IO.Wrapper.Interfaces.IWrapperObject, DiGi.Core.IO.Interfaces.IIOObject, DiGi.Core.Interfaces.IObject

Constructors

WrapperItem(UniqueReference) Constructor

Initializes a new instance of the WrapperItem class with a specified unique reference.

public WrapperItem(DiGi.Core.Classes.UniqueReference? uniqueReference);

Parameters

uniqueReference DiGi.Core.Classes.UniqueReference

The unique reference for the item.

WrapperItem(UniqueReference, JsonNode, string) Constructor

Initializes a new instance of the WrapperItem class with a unique reference, JSON node, and checksum.

public WrapperItem(DiGi.Core.Classes.UniqueReference? uniqueReference, System.Text.Json.Nodes.JsonNode? jsonNode, string? checksum);

Parameters

uniqueReference DiGi.Core.Classes.UniqueReference

The unique reference for the item.

jsonNode System.Text.Json.Nodes.JsonNode

The JSON node associated with the item.

checksum System.String

The checksum of the item.

Properties

WrapperItem.Checksum Property

Gets or sets the checksum associated with the wrapper item.

public string? Checksum { get; set; }

Property Value

System.String

WrapperItem.JsonNode Property

Gets or sets the JSON node data associated with the wrapper item.

public System.Text.Json.Nodes.JsonNode? JsonNode { get; set; }

Property Value

System.Text.Json.Nodes.JsonNode

WrapperItem.UniqueReference Property

Gets or sets the unique reference for the wrapper item.

public DiGi.Core.Classes.UniqueReference? UniqueReference { get; }

Property Value

DiGi.Core.Classes.UniqueReference

WrapperItemValueCluster Class

Represents a cluster of wrapper item values.

public class WrapperItemValueCluster : DiGi.Core.Classes.ValueCluster<DiGi.Core.Classes.TypeReference, DiGi.Core.Classes.UniqueReference, DiGi.Core.IO.Wrapper.Classes.WrapperItem>

Inheritance System.ObjectDiGi.Core.Classes.Cluster<DiGi.Core.Classes.TypeReference,DiGi.Core.Classes.UniqueReference,WrapperItem>DiGi.Core.Classes.ValueCluster<DiGi.Core.Classes.TypeReference,DiGi.Core.Classes.UniqueReference,WrapperItem> → WrapperItemValueCluster

Constructors

WrapperItemValueCluster() Constructor

Initializes a new instance of the WrapperItemValueCluster class.

public WrapperItemValueCluster();

Methods

WrapperItemValueCluster.GetValue(UniqueReference) Method

Retrieves the JSON value associated with the specified unique reference.

public System.Text.Json.Nodes.JsonNode? GetValue(DiGi.Core.Classes.UniqueReference? uniqueReference);

Parameters

uniqueReference DiGi.Core.Classes.UniqueReference

The unique reference used to identify the value.

Returns

System.Text.Json.Nodes.JsonNode
The JSON value associated with the specified unique reference, or null if not found.

WrapperItemValueCluster.GetValue<TJsonNode>(UniqueReference) Method

Retrieves the typed JSON value associated with the specified unique reference.

public TJsonNode? GetValue<TJsonNode>(DiGi.Core.Classes.UniqueReference? uniqueReference)
    where TJsonNode : System.Text.Json.Nodes.JsonNode;

Type parameters

TJsonNode

The type of the JSON node to return.

Parameters

uniqueReference DiGi.Core.Classes.UniqueReference

The unique reference used to identify the value.

Returns

TJsonNode
The typed JSON value associated with the specified unique reference, or null if not found.

Clone this wiki locally