• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

eclipse-aascw / aas-core-codegen / 36640953571

29 Sep 2026 10:40PM UTC coverage: 89.111% (+0.3%) from 88.826%
36640953571

push

github

web-flow
Support set properties (#797)

We allow the sets of primitives and enumeration literals as properties,
``Set[T]`` and ``Optional[Set[T]]``, which the SDKs keep in the same
hash sets as the local sets, so that a set property can be passed
wherever an ``AbstractSet`` argument is expected:

    class Collection(DBC):
        texts: Set[str]
        optional_directions: Optional[Set[Direction]]

We serialize a set as an array of its items sorted in the same order
in all the SDKs: ``false`` before ``true``, the integers numerically,
and the strings by their code points. The enumeration literals follow
their serialized values, ranked at generation time, *e.g.*,
``RankOfDirection``. C#, Java, TypeScript and C++ compare the strings
by UTF-16 code units by default, so we generate a comparator by code
points for them.

The de-serialization accepts the items in any order, but refuses
a duplicate at its own index, as silently dropping it would lose data.
The verification of the constrained items reports the position of
the item in the sorted order, so that the path resolves in
the serialized array. The JSON schema declares ``uniqueItems``, while
the XSD represents a set just as a list of primitives.

We generate ``OverXOrEmpty`` for the optional sets in C#, Java, Python
and TypeScript, just as for the optional lists.

We hash the sets of enumeration literals in C++ with a generated
``common::EnumHash``, as C++11 does not specialize ``std::hash`` for
enumerations. This also affects the constant and local sets.

We import ``java.util`` explicitly in the Java jsonization and in
the generated tests of copying, as the class ``Collection`` of
a meta-model clashed with the wildcard import of ``java.util.*``.

The class ``Collection`` in the common meta-model ``sets`` covers
the feature.

764 of 806 new or added lines in 63 files covered. (94.79%)

2 existing lines in 2 files now uncovered.

44348 of 49767 relevant lines covered (89.11%)

2.67 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

91.89
/aas_core_codegen/java/common.py


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc