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

hr.com.vgv.verano.http.DictInput Maven / Gradle / Ivy

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy