Rename ThreadInfo to LegacyThreadInfo

This commit is contained in:
AsamK 2022-06-07 14:25:28 +02:00
parent 5b5a1718e9
commit 5afe9c5337
2 changed files with 7 additions and 7 deletions

View file

@ -25,9 +25,9 @@ public class LegacyJsonThreadStore {
@JsonProperty("threads") @JsonProperty("threads")
@JsonSerialize(using = MapToListSerializer.class) @JsonSerialize(using = MapToListSerializer.class)
@JsonDeserialize(using = ThreadsDeserializer.class) @JsonDeserialize(using = ThreadsDeserializer.class)
private Map<String, ThreadInfo> threads = new HashMap<>(); private Map<String, LegacyThreadInfo> threads = new HashMap<>();
public List<ThreadInfo> getThreads() { public List<LegacyThreadInfo> getThreads() {
return new ArrayList<>(threads.values()); return new ArrayList<>(threads.values());
} }
@ -41,16 +41,16 @@ public class LegacyJsonThreadStore {
} }
} }
private static class ThreadsDeserializer extends JsonDeserializer<Map<String, ThreadInfo>> { private static class ThreadsDeserializer extends JsonDeserializer<Map<String, LegacyThreadInfo>> {
@Override @Override
public Map<String, ThreadInfo> deserialize( public Map<String, LegacyThreadInfo> deserialize(
JsonParser jsonParser, DeserializationContext deserializationContext JsonParser jsonParser, DeserializationContext deserializationContext
) throws IOException { ) throws IOException {
var threads = new HashMap<String, ThreadInfo>(); var threads = new HashMap<String, LegacyThreadInfo>();
JsonNode node = jsonParser.getCodec().readTree(jsonParser); JsonNode node = jsonParser.getCodec().readTree(jsonParser);
for (var n : node) { for (var n : node) {
var t = jsonProcessor.treeToValue(n, ThreadInfo.class); var t = jsonProcessor.treeToValue(n, LegacyThreadInfo.class);
threads.put(t.id, t); threads.put(t.id, t);
} }

View file

@ -2,7 +2,7 @@ package org.asamk.signal.manager.storage.threads;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
public class ThreadInfo { public class LegacyThreadInfo {
@JsonProperty @JsonProperty
public String id; public String id;