OCLOperators including
This page was created by Alexandra on 2017-08-14. Last edited by Wikiadmin on 2026-07-29.
You can use including to create a collection that contains every element in an existing collection together with one additional object.
Syntax
collection.including(object)collectionis the existing collection, referred to asselfin the operator definition.objectis the element to add.- The result is a collection containing all elements from
collection, followed byobject.
Example
The following expression returns a collection with all elements of myCollection and newObject included:
myCollection.including(newObject)OrderedSet limitation
Important: The OCL standard library has a documented issue in which using including on an OrderedSet changes the result into a Set. If your expression relies on the ordering of an OrderedSet, verify the result type and ordering after using including.
