All Downloads are FREE. Search and download functionalities are using the official Maven repository.

au.org.consumerdatastandards.support.model.ModelBase Maven / Gradle / Ivy

Go to download

This artefact describes the Consumer Data Standards using Java classes and annotations in a way suitable for automatic generation of Open API Specification, documentation, Server Stub, Client Libraries and Reference Test.

There is a newer version: 1.1.1
Show newest version
package au.org.consumerdatastandards.support.model;

import au.org.consumerdatastandards.support.data.CustomAttribute;
import au.org.consumerdatastandards.support.util.CustomAttributesUtil;

import java.util.Comparator;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;

public class ModelBase {

    protected Set attributes = new TreeSet<>(Comparator.comparing(attribute -> (attribute.name() + attribute.value())));

    public void add(CustomAttribute customAttribute) {

        attributes.add(customAttribute);
    }

    public void addAll(CustomAttribute[] customAttributes) {

        for (CustomAttribute customAttribute : customAttributes) {
            add(customAttribute);
        }
    }

    public Map getGroupedAttributes() {

        return CustomAttributesUtil.getGroupedAttributes(attributes);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy