au.org.consumerdatastandards.support.model.ModelBase Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of api-model Show documentation
Show all versions of api-model Show documentation
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.
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