de.otto.synapse.state.DelegatingStateRepository Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of synapse-core Show documentation
Show all versions of synapse-core Show documentation
A library used at otto.de to implement Spring Boot based event-sourcing microservices.
package de.otto.synapse.state;
import java.util.Optional;
import java.util.Set;
import java.util.function.BiConsumer;
import java.util.function.BiFunction;
public class DelegatingStateRepository implements StateRepository {
private final StateRepository delegate;
public DelegatingStateRepository(final StateRepository delegate) {
this.delegate = delegate;
}
@Override
public String getName() {
return delegate.getName();
}
@Override
public Optional compute(String key, BiFunction super String, ? super Optional, ? extends V> remappingFunction) {
return delegate.compute(key, remappingFunction);
}
@Override
public void consumeAll(BiConsumer super String, ? super V> consumer) {
delegate.consumeAll(consumer);
}
@Override
public Optional put(String key, V value) {
return delegate.put(key,value);
}
@Override
public Optional remove(String key) {
return delegate.remove(key);
}
@Override
public void clear() {
delegate.clear();
}
@Override
public Optional get(String key) {
return delegate.get(key);
}
@Override
public Set keySet() {
return delegate.keySet();
}
@Override
public long size() {
return delegate.size();
}
@Override
public void close() throws Exception {
delegate.close();
}
}