- if (constraints != null) {
- List<ToscaConstraint> toscaConstraints = new ArrayList<>();
-
- for (JpaToscaConstraint constraint : constraints) {
- toscaConstraints.add(constraint.toAuthorative());
- }
-
- toscaDataType.setConstraints(toscaConstraints);
- }
-
- if (properties != null) {
- Map<String, ToscaProperty> propertyMap = new LinkedHashMap<>();
-
- for (Entry<String, JpaToscaProperty> entry : properties.entrySet()) {
- propertyMap.put(entry.getKey(), entry.getValue().toAuthorative());
- }
-
- toscaDataType.setProperties(propertyMap);
- }
+ toscaDataType.setConstraints(PfUtils.mapList(constraints, JpaToscaConstraint::toAuthorative));
+ toscaDataType.setProperties(PfUtils.mapMap(properties, JpaToscaProperty::toAuthorative));