com.github.phantomthief.util.IMultiDataAccess Maven / Gradle / Ivy
package com.github.phantomthief.util;
import static java.util.Collections.emptyMap;
import java.util.Collection;
import java.util.Map;
import java.util.function.Consumer;
import java.util.function.Function;
/**
* @author w.vela
*/
public interface IMultiDataAccess {
static IMultiDataAccess getOnly(Function, Map> getFunction) {
return new IMultiDataAccess() {
@Override
public Map get(Collection keys) {
return getFunction.apply(keys);
}
};
}
static IMultiDataAccess setOnly(Consumer