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

io.vertx.tp.crud.actor.HeaderActor Maven / Gradle / Ivy

There is a newer version: 0.9.0
Show newest version
package io.vertx.tp.crud.actor;

import io.vertx.core.MultiMap;
import io.vertx.core.json.JsonObject;
import io.vertx.tp.crud.atom.IxConfig;
import io.vertx.up.atom.Envelop;
import io.zero.epic.Ut;

class HeaderActor extends AbstractActor {

    @Override
    public JsonObject proc(final JsonObject data, final IxConfig config) {
        final Envelop request = this.getRequest();
        final MultiMap headers = request.headers();
        /* Header Data */
        final JsonObject headerConfig = config.getHeader();
        if (null != headerConfig) {
            Ut.itJObject(headerConfig, (to, from) -> {
                final String value = headers.get(to.toString());
                if (Ut.notNil(value)) {
                    data.put(from, value);
                }
            });
        }
        return data;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy