![JAR search and dependency download from the Maven repository](/logo.png)
com.kolibrifx.plovercrest.server.internal.protocol.SubscriberEntryCollection Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of plovercrest-server Show documentation
Show all versions of plovercrest-server Show documentation
Plovercrest server library.
The newest version!
/*
* Copyright (c) 2010-2017, KolibriFX AS. Licensed under the Apache License, version 2.0.
*/
package com.kolibrifx.plovercrest.server.internal.protocol;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
public class SubscriberEntryCollection {
private final Map> entriesByTableIndex = new LinkedHashMap<>();
public SubscriberEntry getLastEntry(final int tableIndex) {
final List collection = entriesByTableIndex.get(tableIndex);
if (collection == null) {
return null;
}
assert !collection.isEmpty();
return collection.get(collection.size() - 1);
}
public void add(final SubscriberEntry entry) {
List collection = entriesByTableIndex.get(entry.subscriptionId);
if (collection == null) {
collection = new ArrayList<>();
entriesByTableIndex.put(entry.subscriptionId, collection);
}
collection.add(entry);
}
public Map> getEntriesByTableIndex() {
return entriesByTableIndex;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy