diff options
author | 2021-08-11 03:10:02 +0200 | |
---|---|---|
committer | 2021-08-11 03:10:02 +0200 | |
commit | 190652f6441f4fb6f020b19a648560b2f5e407e2 (patch) | |
tree | c0d1c7675cf5de9c530b85354f6a10b92b5826ce /model-data | |
parent | Map.put returns old value, ugly solution (diff) | |
download | refinery-190652f6441f4fb6f020b19a648560b2f5e407e2.tar.gz refinery-190652f6441f4fb6f020b19a648560b2f5e407e2.tar.zst refinery-190652f6441f4fb6f020b19a648560b2f5e407e2.zip |
Model put returns old value
Diffstat (limited to 'model-data')
-rw-r--r-- | model-data/src/main/java/org/eclipse/viatra/solver/data/model/Model.java | 2 | ||||
-rw-r--r-- | model-data/src/main/java/org/eclipse/viatra/solver/data/model/internal/ModelImpl.java | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/model-data/src/main/java/org/eclipse/viatra/solver/data/model/Model.java b/model-data/src/main/java/org/eclipse/viatra/solver/data/model/Model.java index a19e4d5f..2b21e3e7 100644 --- a/model-data/src/main/java/org/eclipse/viatra/solver/data/model/Model.java +++ b/model-data/src/main/java/org/eclipse/viatra/solver/data/model/Model.java | |||
@@ -12,7 +12,7 @@ public interface Model extends Versioned{ | |||
12 | 12 | ||
13 | <K,V> V get(DataRepresentation<K,V> representation, K key); | 13 | <K,V> V get(DataRepresentation<K,V> representation, K key); |
14 | <K,V> Cursor<K,V> getAll(DataRepresentation<K,V> representation); | 14 | <K,V> Cursor<K,V> getAll(DataRepresentation<K,V> representation); |
15 | <K,V> void put(DataRepresentation<K,V> representation, K key, V value); | 15 | <K,V> V put(DataRepresentation<K,V> representation, K key, V value); |
16 | <K,V> void putAll(DataRepresentation<K,V> representation, Cursor<K,V> cursor); | 16 | <K,V> void putAll(DataRepresentation<K,V> representation, Cursor<K,V> cursor); |
17 | <K,V> long getSize(DataRepresentation<K,V> representation); | 17 | <K,V> long getSize(DataRepresentation<K,V> representation); |
18 | 18 | ||
diff --git a/model-data/src/main/java/org/eclipse/viatra/solver/data/model/internal/ModelImpl.java b/model-data/src/main/java/org/eclipse/viatra/solver/data/model/internal/ModelImpl.java index 55ddfd3a..6d7f4e97 100644 --- a/model-data/src/main/java/org/eclipse/viatra/solver/data/model/internal/ModelImpl.java +++ b/model-data/src/main/java/org/eclipse/viatra/solver/data/model/internal/ModelImpl.java | |||
@@ -57,8 +57,8 @@ public class ModelImpl implements Model { | |||
57 | } | 57 | } |
58 | 58 | ||
59 | @Override | 59 | @Override |
60 | public <K, V> void put(DataRepresentation<K, V> representation, K key, V value) { | 60 | public <K, V> V put(DataRepresentation<K, V> representation, K key, V value) { |
61 | getMapValidateKey(representation, key).put(key, value); | 61 | return getMapValidateKey(representation, key).put(key, value); |
62 | } | 62 | } |
63 | 63 | ||
64 | @Override | 64 | @Override |