com.netflix.archaius.config.polling.PollingResponse Maven / Gradle / Ivy
package com.netflix.archaius.config.polling;
import java.util.Collection;
import java.util.Collections;
import java.util.Map;
public abstract class PollingResponse {
public static PollingResponse forSnapshot(final Map values) {
return new PollingResponse() {
@Override
public Map getToAdd() {
return values;
}
@Override
public Collection getToRemove() {
return Collections.emptyList();
}
@Override
public boolean hasData() {
return true;
}
};
}
public static PollingResponse noop() {
return new PollingResponse() {
@Override
public Map getToAdd() {
return Collections.emptyMap();
}
@Override
public Collection getToRemove() {
return Collections.emptyList();
}
@Override
public boolean hasData() {
return false;
}
};
}
public abstract Map getToAdd();
public abstract Collection getToRemove();
public abstract boolean hasData();
}