All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.netflix.archaius.config.polling.PollingResponse Maven / Gradle / Ivy

There is a newer version: 2.8.2
Show newest version
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(); 
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy