hr.com.vgv.verano.http.DictInput Maven / Gradle / Ivy
package hr.com.vgv.verano.http;
import org.cactoos.Func;
import org.cactoos.func.UncheckedFunc;
/**
* Input to be attached to a dictionary.
* @since 1.0
*/
public interface DictInput
{
Dict apply(Dict dict);
class Simple implements DictInput
{
private final UncheckedFunc origin;
public Simple(final Kvp... kvps) {
this((Dict dict) -> new JoinedDict(
dict,
new HashDict(kvps))
);
}
public Simple(final Func origin) {
this.origin = new UncheckedFunc<>(origin);
}
@Override
public final Dict apply(final Dict dict) {
return this.origin.apply(dict);
}
}
}