Skip to content

Latest commit

 

History

History
153 lines (113 loc) · 4.62 KB

converters.rst

File metadata and controls

153 lines (113 loc) · 4.62 KB

Converters

Getting Started

The VersaTul Object Converters project provides the ability to convert objects into key/value pairs dictionary stores. For example, converters can be used to convert instance of classes into a dictionary representation of the data from the class. This package works with the Collection streamers package.

Installation

To use VersaTul Converters, first install it using nuget:

PM> NuGet\Install-Package VersaTul.Object.Converters -Version latest

Main Components

  1. IFlattener : Describes the functionality needed to successfully convert from a multi-dimensional object to a one-dimensional key/value pair dictionary with flattened keys.
  2. IObjectProcessor : Represent functionality that can convert an object into a dictionary of string keys and object values.
  3. IPropertyProcessor : Describes the functionality needed to successfully process the properties of object instances.
  4. Flattener : The concrete implementation of IFlattener.
  5. ObjectProcessor : The concrete implementation of IObjectProcessor.
  6. PropertyProcessor : The concrete implementation of IPropertyProcessor.

Functional Summary

  1. IDictionary<string, object> IFlattener.AsDictionary(IDictionary<string, object> source) : Converts the given dictionary of string, objects with different levels of object depth into one level. Essentially create a dictionary flatter dictionary with keys/values.
  2. string IFlattener.AsString(object source) : Converts the given object from a multi-dimensional object to one-dimensional string.
  3. IDictionary<string, object> IObjectProcessor.ToDictionary(object source) : Converts the given object into a dictionary of String keys and value objects.
  4. object IPropertyProcessor.Process() : Overloaded method for analyzing a given property of an object and its values to see if further processing is needed in order to flatten the given object.

Code Examples

Changelog

V1.0.10

  • Class to dictionary support
  • Minor fixes

V1.0.9

  • Dependent package updates
  • Minor fixes

V1.0.8

  • Code ported to dotnet core
  • Documentation completed