Commit 792f9274 authored by Jörg Richter's avatar Jörg Richter

ModelFactory API: add `newTopicModel(id, value)` (#341)

1 new method:

    TopicModel newTopicModel(long id, SimpleValue value);

It is useful for constructing an update model to replace a particular value in a multi-value.
Note: for composite values (ChildTopics) an analog method exists already.
parent 43b8783b
Pipeline #9888 passed with stages
in 7 minutes and 53 seconds
......@@ -100,6 +100,11 @@ public class ModelFactoryImpl implements ModelFactory {
return newTopicModel(id, null, null, null, null);
}
@Override
public TopicModelImpl newTopicModel(long id, SimpleValue value) {
return newTopicModel(id, null, null, value, null);
}
@Override
public TopicModelImpl newTopicModel(long id, ChildTopicsModel childTopics) {
return newTopicModel(id, null, null, null, childTopics);
......
......@@ -54,10 +54,9 @@ public interface ModelFactory {
// TODO: make internal?
TopicModel newTopicModel(long id);
// TODO: make internal? -> Rather not. Might be needed by app developer to replace a multi-value.
TopicModel newTopicModel(long id, ChildTopicsModel childTopics);
TopicModel newTopicModel(long id, SimpleValue value);
// TODO: add newTopicModel(long id, SimpleValue value)?
TopicModel newTopicModel(long id, ChildTopicsModel childTopics);
TopicModel newTopicModel(TopicModel topic);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment