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

org.dominokit.rest.shared.request.HasHeadersAndParameters Maven / Gradle / Ivy

The newest version!
/*
 * Copyright © 2019 Dominokit
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.dominokit.rest.shared.request;

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

/**
 * An interface that allows the caller to set headers, headers parameters, query parameters and path
 * parameters to the request
 *
 * @param  the request type
 * @param  the response type
 */
public interface HasHeadersAndParameters {
  /**
   * Sets header name and value, adding or overriding existing one
   *
   * @param name the name of the header
   * @param value the value of the header
   * @return same instance to support builder pattern
   */
  HasHeadersAndParameters setHeader(String name, String value);

  /**
   * Sets a list of headers names and values
   *
   * @param headers the headers
   * @return same instance to support builder pattern
   */
  HasHeadersAndParameters setHeaders(Map headers);

  /**
   * Sets query parameter name and value, and overrides existing value
   *
   * @param name the name of the parameter
   * @param value the value of the parameter
   * @return same instance to support builder pattern
   */
  HasHeadersAndParameters setQueryParameter(String name, String value);

  /**
   * Sets a list of query parameters names and values, and overrides existing values
   *
   * @param queryParameters the parameters
   * @return same instance to support builder pattern
   */
  HasHeadersAndParameters setQueryParameters(Map> queryParameters);

  /**
   * adds a new value to an exiting query parameter
   *
   * @param name the name of the parameter
   * @param value the value of the parameter
   * @return same instance to support builder pattern
   */
  HasHeadersAndParameters addQueryParameter(String name, String value);

  /**
   * adds a new values to an exiting query parameters
   *
   * @param queryParameters the parameters
   * @return same instance to support builder pattern
   */
  HasHeadersAndParameters addQueryParameters(Map> queryParameters);

  /**
   * Sets a list of path parameters names and values
   *
   * @param pathParameters the parameters
   * @return same instance to support builder pattern
   */
  HasHeadersAndParameters setPathParameters(Map pathParameters);

  /**
   * Sets a path parameter name and value
   *
   * @param name the name of the parameter
   * @param value the value of the parameter
   * @return same instance to support builder pattern
   */
  HasHeadersAndParameters setPathParameter(String name, String value);

  /**
   * Sets a list of header parameters names and values
   *
   * @param headerParameters the parameters
   * @return same instance to support builder pattern
   */
  HasHeadersAndParameters setHeaderParameters(Map headerParameters);

  /**
   * Sets a header parameter name and value
   *
   * @param name the name of the parameter
   * @param value the value of the parameter
   * @return same instance to support builder pattern
   */
  HasHeadersAndParameters setHeaderParameter(String name, String value);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy