Data

This package contains a set of abstract, portable data types. Some examples are anytype, anyvalues, anyarrays, anymaps, and stringmaps. Many serializable classes are based on these data types. For example, the classes configmap, filtermaps and connection parameters, which extend stringvaluemap. The package also includes several classes for working with data (E.g. data paging, filtering, GUIDs).

Interfaces

IChangeable

Interface for data objects that need to store the last modified date and time.

ICloneable

Interface for data objects that are able to create their full binary copy.

IIdentifiable

Generic interface for data objects that can be uniquely identified by an id. The type specified in the interface defines the type of id field.

INamed

Interface for data objects that have human-readable names.

IStringIdentifiable

Interface for data objects that can be uniquely identifed by a string id. The interface extends IIdentifiable to hardcode id type to string. It is a common pattern to use a string GUID as the id, generated by IdGenerator.

ITrackable

Interface for data objects that can track their changes, including logical deletion.

IVersioned

Interface for data objects that can be versioned. Versioning is often used as optimistic concurrency mechanism. The version doesn’t have to be a number, but it is recommended to use sequential values to determine if one object has a newer or older version than another one. It is a common pattern to use the time of change as the object version.


Classes

AnyValue

Cross-language implementation of a dynamic object that can hold a value of any type. The stored value can be converted to different types using a variety of accessor methods.

AnyValueArray

Cross-language implementation of a dynamic object array that can hold values of any type. The stored values can be converted to different types using a variety of accessor methods.

AnyValueMap

Cross-language implementation of a dynamic object map (dictionary) that can hold values of any type. The stored values can be converted to different types using a variety of accessor methods.

DataPage

Data transfer object that is used to pass results of paginated queries. It contains items of retrieved page and optional total number of items. Most often this object type is used to send responses to paginated queries. Pagination parameters are defined by a PagingParams object. The skip parameter in the PagingParams indicates how many items to skip. The takes parameter sets number of items to return in the page. And the optional total parameter tells to return the total number of items in the query.

FilterParams

Data transfer object used to pass filter parameters as simple key-value pairs.

IdGenerator

Helper class to generate unique object IDs. It supports two types of IDs: long and short. Long IDs are string GUIDs. They are globally unique and 32-character long. ShortIDs are just 9-digit random numbers. They are not guaranteed to be unique.

MultiString

An object that contains string translations for multiple languages. Language keys use two-letter codes like: ‘en’, ‘sp’, ‘de’, ‘ru’, ‘fr’, ‘pr’. When a translation for specified language does not exist, it defaults to English (‘en’). When an English translation does not exist, it falls back to the first defined language.

PagingParams

Data transfer object to pass paging parameters for queries. The page is defined by two parameters:

  • the skip parameter defines the number of items to skip.
  • the take parameter sets how many items to return in a page.
  • additionally, the optional total parameter tells to return total number of items in the query.

ProjectionParams

Defines projection parameters with a list of fields to include into query results. The parameters support two formats: dot format and nested format. The dot format is the standard way to define included fields and subfields using dot object notation: “field1,field2.field21,field2.field22.field221”

SortField

Defines a field name and order used to sort query results.

SortParams

Defines a list of field names used to sort query results.

StringValueMap

Cross-language implementation of a map (dictionary) where all keys and values are strings. The stored values can be converted to different types using a variety of accessor methods. The string map is highly versatile. It can be converted into many formats, stored and sent over the wire.

TagsProcessor

Helper class to extract and process search tags from objects. The search tags can be kept individually or embedded as hash tags inside text like “This text has #hash_tag that can be used for search.”

TokenizedDataPage

Data transfer object that is used to pass results of paginated queries. It contains items of a retrieved page and total number of items (optional ). Most often, this object type is used to send responses to paginated queries.

TokenizedPagingParams

Data transfer object used to pass tokenized paging parameters for queries. It can be used for complex paging scenarios, like paging across multiple databases where the previous state is encoded in a token. The token is usually retrieved from the previous response. The initial request shall go with token == null.