@Test public void getCopyOfKeyToFieldMapTest() { ConfigurationModelMutable configurationModelMutable = createConfigurationModelMutable(); configurationModelMutable.put(configurationFieldModel); Map<String, ConfigurationFieldModel> configurationFieldModelMap = configurationModelMutable.getCopyOfKeyToFieldMap(); assertEquals(1, configurationFieldModelMap.size()); assertEquals(configurationFieldModel, configurationFieldModelMap.get(fieldKey)); }
public void put(ConfigurationFieldModel configFieldModel) { Objects.requireNonNull(configFieldModel); String fieldKey = configFieldModel.getFieldKey(); Objects.requireNonNull(fieldKey); if (getConfiguredFields().containsKey(fieldKey)) { ConfigurationFieldModel oldConfigField = getConfiguredFields().get(fieldKey); List<String> values = combine(oldConfigField, configFieldModel); oldConfigField.setFieldValues(values); } else { getConfiguredFields().put(fieldKey, configFieldModel); } }
ConfigurationModelMutable extends ConfigurationModel { public void put(ConfigurationFieldModel configFieldModel) { Objects.requireNonNull(configFieldModel); String fieldKey = configFieldModel.getFieldKey(); Objects.requireNonNull(fieldKey); if (getConfiguredFields().containsKey(fieldKey)) { ConfigurationFieldModel oldConfigField = getConfiguredFields().get(fieldKey); List<String> values = combine(oldConfigField, configFieldModel); oldConfigField.setFieldValues(values); } else { getConfiguredFields().put(fieldKey, configFieldModel); } } }
ConfigurationModelMutable extends ConfigurationModel { public void put(ConfigurationFieldModel configFieldModel) { Objects.requireNonNull(configFieldModel); String fieldKey = configFieldModel.getFieldKey(); Objects.requireNonNull(fieldKey); if (getConfiguredFields().containsKey(fieldKey)) { ConfigurationFieldModel oldConfigField = getConfiguredFields().get(fieldKey); List<String> values = combine(oldConfigField, configFieldModel); oldConfigField.setFieldValues(values); } else { getConfiguredFields().put(fieldKey, configFieldModel); } } ConfigurationModelMutable(Long registeredDescriptorId, Long descriptorConfigId, String createdAt, String lastUpdated, String context);  ConfigurationModelMutable(Long registeredDescriptorId, Long descriptorConfigId, String createdAt, String lastUpdated, ConfigContextEnum context); }
ConfigurationModelMutable extends ConfigurationModel { public void put(ConfigurationFieldModel configFieldModel) { Objects.requireNonNull(configFieldModel); String fieldKey = configFieldModel.getFieldKey(); Objects.requireNonNull(fieldKey); if (getConfiguredFields().containsKey(fieldKey)) { ConfigurationFieldModel oldConfigField = getConfiguredFields().get(fieldKey); List<String> values = combine(oldConfigField, configFieldModel); oldConfigField.setFieldValues(values); } else { getConfiguredFields().put(fieldKey, configFieldModel); } } ConfigurationModelMutable(Long registeredDescriptorId, Long descriptorConfigId, String createdAt, String lastUpdated, String context);  ConfigurationModelMutable(Long registeredDescriptorId, Long descriptorConfigId, String createdAt, String lastUpdated, ConfigContextEnum context); void put(ConfigurationFieldModel configFieldModel); }
ConfigurationModelMutable extends ConfigurationModel { public void put(ConfigurationFieldModel configFieldModel) { Objects.requireNonNull(configFieldModel); String fieldKey = configFieldModel.getFieldKey(); Objects.requireNonNull(fieldKey); if (getConfiguredFields().containsKey(fieldKey)) { ConfigurationFieldModel oldConfigField = getConfiguredFields().get(fieldKey); List<String> values = combine(oldConfigField, configFieldModel); oldConfigField.setFieldValues(values); } else { getConfiguredFields().put(fieldKey, configFieldModel); } } ConfigurationModelMutable(Long registeredDescriptorId, Long descriptorConfigId, String createdAt, String lastUpdated, String context);  ConfigurationModelMutable(Long registeredDescriptorId, Long descriptorConfigId, String createdAt, String lastUpdated, ConfigContextEnum context); void put(ConfigurationFieldModel configFieldModel);  }