Source:
<code>public static Provider<OpenstackNetworkProviderProperties> map(OpenStackNetworkProvider model, Provider<OpenstackNetworkProviderProperties> template) { Provider<OpenstackNetworkProviderProperties> entity = template != null? template: new Provider<>(); entity.setType(ProviderType.OPENSTACK_NETWORK); if (model.isSetId()) { entity.setId(GuidUtils.asGuid(model.getId())); } if (model.isSetName()) { entity.setName(model.getName()); } if (model.isSetDescription()) { entity.setDescription(model.getDescription()); } if (model.isSetUrl()) { entity.setUrl(model.getUrl()); } if (model.isSetRequiresAuthentication()) { entity.setRequiringAuthentication(model.isRequiresAuthentication()); } if (model.isSetUsername()) { entity.setUsername(model.getUsername()); } if (model.isSetPassword()) { entity.setPassword(model.getPassword()); } if (model.isSetAuthenticationUrl()) { entity.setAuthUrl(model.getAuthenticationUrl()); } if (model.isSetProperties()) { Map<String, String> map = new HashMap<>(); for (Property property : model.getProperties().getProperties()) { map.put(property.getName(), property.getValue()); } entity.setCustomProperties(map); } OpenstackNetworkProviderProperties additionalProperties = new OpenstackNetworkProviderProperties(); if (model.isSetTenantName()) { additionalProperties.setTenantName(model.getTenantName()); } if (model.isSetPluginType()) { additionalProperties.setPluginType(map(model.getPluginType())); } if (model.isSetAgentConfiguration()) { additionalProperties.setAgentConfiguration(map(model.getAgentConfiguration(), null)); } <START> additionalProperties.setReadOnly(!model.isSetReadOnly() || model.isReadOnly()); <END> entity.setAdditionalProperties(additionalProperties); return entity; }</code><technical_language>In general avoid calling backend setter if user provided a value: if (model.isSetReadOnly()) { additionalProperties.setReadOnly(model.isReadOnly()); } reason if call setter overriding backend default values, trigger side effects. Is reason do differently here</technical_language>

Target:
public static Provider<OpenstackNetworkProviderProperties> map(OpenStackNetworkProvider model, Provider<OpenstackNetworkProviderProperties> template) { Provider<OpenstackNetworkProviderProperties> entity = template != null? template: new Provider<>(); entity.setType(ProviderType.OPENSTACK_NETWORK); if (model.isSetId()) { entity.setId(GuidUtils.asGuid(model.getId())); } if (model.isSetName()) { entity.setName(model.getName()); } if (model.isSetDescription()) { entity.setDescription(model.getDescription()); } if (model.isSetUrl()) { entity.setUrl(model.getUrl()); } if (model.isSetRequiresAuthentication()) { entity.setRequiringAuthentication(model.isRequiresAuthentication()); } if (model.isSetUsername()) { entity.setUsername(model.getUsername()); } if (model.isSetPassword()) { entity.setPassword(model.getPassword()); } if (model.isSetAuthenticationUrl()) { entity.setAuthUrl(model.getAuthenticationUrl()); } if (model.isSetProperties()) { Map<String, String> map = new HashMap<>(); for (Property property : model.getProperties().getProperties()) { map.put(property.getName(), property.getValue()); } entity.setCustomProperties(map); } OpenstackNetworkProviderProperties additionalProperties = new OpenstackNetworkProviderProperties(); if (model.isSetTenantName()) { additionalProperties.setTenantName(model.getTenantName()); } if (model.isSetPluginType()) { additionalProperties.setPluginType(map(model.getPluginType())); } if (model.isSetAgentConfiguration()) { additionalProperties.setAgentConfiguration(map(model.getAgentConfiguration(), null)); } if (model.isSetReadOnly()) { additionalProperties.setReadOnly(model.isReadOnly()); } entity.setAdditionalProperties(additionalProperties); return entity; }