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

org.zalando.logbook.UpdateHttpHeaders Maven / Gradle / Ivy

There is a newer version: 3.10.0
Show newest version
package org.zalando.logbook;

import java.util.Arrays;
import java.util.List;
import java.util.Map;

import static org.zalando.logbook.Fold.fold;

interface UpdateHttpHeaders extends HttpHeaders {

    @Override
    default HttpHeaders update(
            final String name,
            final String... values) {

        return update(name, Arrays.asList(values));
    }

    @Override
    default HttpHeaders update(
            final Map> headers) {

        final HttpHeaders self = this;
        return fold(headers.entrySet(), self, (result, entry) -> {
            final String name = entry.getKey();
            final List values = entry.getValue();
            return result.update(name, values);
        });
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy