public Builder addAttributes(String name, TAttributeAssignment attribute) { if (name == null || name.isEmpty()) { return this; } return addAttributes(Collections.singletonMap(name, attribute)); }
public Builder addProperties(String name, TPropertyAssignment property) { if (name == null || name.isEmpty()) { return this; } return addProperties(Collections.singletonMap(name, property)); }
public Map<String, TCapabilityAssignment> convert(TCapability node) { if (Objects.isNull(node)) return null; return Collections.singletonMap( node.getName(), new TCapabilityAssignment.Builder() .setProperties(convert(node, node.getProperties())) .build() ); }
@Nullable public TCapabilityAssignment buildCapabilityAssignment(Object object, Parameter<TCapabilityAssignment> parameter) { if (Objects.isNull(object) || !validate(TCapabilityAssignment.class, object, parameter)) return null; @SuppressWarnings("unchecked") Map<String, Object> map = (Map<String, Object>) object; return new TCapabilityAssignment.Builder() .setProperties(buildMap(map, "properties", this::buildPropertyAssignment, parameter)) .setAttributes(buildMap(map, "attributes", this::buildAttributeAssignment, parameter)) .build(); }