
com.almworks.jira.structure.util.EntityVersionTracker Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of structure-api Show documentation
Show all versions of structure-api Show documentation
Public API for the Structure Plugin for JIRA
package com.almworks.jira.structure.util;
import com.almworks.integers.*;
public interface EntityVersionTracker {
EntityVersionUpdate getUpdate(long fromVersion);
long getCurrentVersion();
final class EntityVersionUpdate {
private final long myFromVersion;
private final long myToVersion;
private final boolean myFullUpdate;
private final LongSet myChangedEntities;
private EntityVersionUpdate(long fromVersion, long toVersion, boolean fullUpdate, LongSet changedEntities) {
myFromVersion = fromVersion;
myToVersion = toVersion;
myFullUpdate = fullUpdate;
myChangedEntities = changedEntities;
}
public static EntityVersionUpdate empty(long version) {
return new EntityVersionUpdate(version, version, false, LongSet.EMPTY);
}
public static EntityVersionUpdate incremental(long fromVersion, long toVersion, LongIterable changedEntities) {
return new EntityVersionUpdate(fromVersion, toVersion, false, LongOpenHashSet.createFrom(changedEntities));
}
public static EntityVersionUpdate full(long fromVersion, long toVersion) {
return new EntityVersionUpdate(fromVersion, toVersion, true, LongSet.EMPTY);
}
public long getFromVersion() {
return myFromVersion;
}
public long getToVersion() {
return myToVersion;
}
public boolean isFullUpdate() {
return myFullUpdate;
}
public LongSet getChangedEntities() {
return myChangedEntities;
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy