Composite attribute

Attribute type idType specific restriction parameters
compositeNo restrictions. Each sub-attribute of composite attribute can have it’s own restrictions.

πŸ“˜

Sub-attributes are presented in the order they are defined in the composite.

Code Examples:

{
  "id" : "ADDRESS",
  "name" : "Address",
  "type" : {
    "id" : "composite",
    "restriction" : { }
  },
  "attributeLinks" : [ {
    "id" : "ADDRESS_LINE_1",
    "appliesTo" : "ALL"
  }, {
    "id" : "ADDRESS_LINE_2",
    "optional" : true,
    "appliesTo" : "ALL"
  }, {
    "id" : "COUNTRY",
    "appliesTo" : "ALL"
  }, {
    "id" : "ZIP_CODE",
    "appliesTo" : "ALL"
  } ]
}
Attribute compositeAttribute = AttributeBuilder.compositeAttribute("ADDRESS", "Address")
        .withChildAttribute(AttributeBuilder.stringAttribute("ADDRESS_LINE_1", "Line 1").build(), false)
        .withChildAttribute(AttributeBuilder.stringAttribute("ADDRESS_LINE_2", "Line 2").build(), true)
        .withChildAttributes(List.of(AttributeBuilder.stringAttribute("COUNTRY", "Country").build(), 
                AttributeBuilder.stringAttribute("ZIP_CODE", "Zip code").build()), false)
        .build();