@Test public void setKeyToValuesTest() { String descriptor = "description1"; String context = "context1"; String key1 = "original key"; String key2 = "key to be added into keyToValues"; FieldValueModel testFieldValueModel = Mockito.mock(FieldValueModel.class); Map<String, FieldValueModel> keyToValues = new HashMap<>(); keyToValues.put(key1, testFieldValueModel); FieldModel testFieldModel = new FieldModel(descriptor, context, keyToValues); assertTrue(testFieldModel.getKeyToValues().containsKey(key1)); assertFalse(testFieldModel.getKeyToValues().containsKey(key2)); keyToValues.put(key2, testFieldValueModel); testFieldModel.setKeyToValues(keyToValues); assertTrue(testFieldModel.getKeyToValues().containsKey(key1)); assertTrue(testFieldModel.getKeyToValues().containsKey(key2)); }
public void setKeyToValues(final Map<String, FieldValueModel> keyToValues) { this.keyToValues = keyToValues; }
FieldModel extends Config { public void setKeyToValues(final Map<String, FieldValueModel> keyToValues) { this.keyToValues = keyToValues; } }
FieldModel extends Config { public void setKeyToValues(final Map<String, FieldValueModel> keyToValues) { this.keyToValues = keyToValues; } private  FieldModel();  FieldModel(String descriptorName, String context, Map<String, FieldValueModel> keyToValues);  FieldModel(String configId, String descriptorName, String context, Map<String, FieldValueModel> keyToValues);  FieldModel(String descriptorName, String context, String createdAt, String lastUpdated, Map<String, FieldValueModel> keyToValues);  FieldModel(String configId, String descriptorName, String context, String createdAt, String lastUpdated, Map<String, FieldValueModel> keyToValues); }
FieldModel extends Config { public void setKeyToValues(final Map<String, FieldValueModel> keyToValues) { this.keyToValues = keyToValues; } private  FieldModel();  FieldModel(String descriptorName, String context, Map<String, FieldValueModel> keyToValues);  FieldModel(String configId, String descriptorName, String context, Map<String, FieldValueModel> keyToValues);  FieldModel(String descriptorName, String context, String createdAt, String lastUpdated, Map<String, FieldValueModel> keyToValues);  FieldModel(String configId, String descriptorName, String context, String createdAt, String lastUpdated, Map<String, FieldValueModel> keyToValues); String getDescriptorName(); String getContext(); String getCreatedAt(); String getLastUpdated(); Map<String, FieldValueModel> getKeyToValues(); void setKeyToValues(final Map<String, FieldValueModel> keyToValues); Optional<FieldValueModel> getFieldValueModel(final String key); Optional<String> getFieldValue(final String key); void putField(final String key, final FieldValueModel field); void removeField(final String key); FieldModel fill(final FieldModel fieldModel); }
FieldModel extends Config { public void setKeyToValues(final Map<String, FieldValueModel> keyToValues) { this.keyToValues = keyToValues; } private  FieldModel();  FieldModel(String descriptorName, String context, Map<String, FieldValueModel> keyToValues);  FieldModel(String configId, String descriptorName, String context, Map<String, FieldValueModel> keyToValues);  FieldModel(String descriptorName, String context, String createdAt, String lastUpdated, Map<String, FieldValueModel> keyToValues);  FieldModel(String configId, String descriptorName, String context, String createdAt, String lastUpdated, Map<String, FieldValueModel> keyToValues); String getDescriptorName(); String getContext(); String getCreatedAt(); String getLastUpdated(); Map<String, FieldValueModel> getKeyToValues(); void setKeyToValues(final Map<String, FieldValueModel> keyToValues); Optional<FieldValueModel> getFieldValueModel(final String key); Optional<String> getFieldValue(final String key); void putField(final String key, final FieldValueModel field); void removeField(final String key); FieldModel fill(final FieldModel fieldModel);  }