Collections

Charta natively supports a number of collections. In this section each of them is explained.

Charta supports a number of collections which can be used to store objects together making them part of a larger whole. All collections are parameterized in their value type. This means that collections in Charta are type-safe. If a collection is declared to store Persons, then it is only possible to add Persons to that collection. Also, when retrieving values from that collection those values are guaranteed to be Persons as well.

Charta supports the following collections:

A Set is a collection of objects where order is not important and every object can occur only once.
A List is a collection of objects where order is important. Objects can occur more than once in the same list.
A Map is a collection of key/value pairs. Values can be added and retrieved based on an accompanying key.