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

com.gooddata.sdk.common.util.MutableUri Maven / Gradle / Ivy

/*
 * Copyright (C) 2007-2020, GoodData(R) Corporation. All rights reserved.
 * This source code is licensed under the BSD-style license found in the
 * LICENSE.txt file in the root directory of this source tree.
 */
package com.gooddata.sdk.common.util;

import org.springframework.util.MultiValueMap;

import java.net.URI;

/**
 * Mutable form of URI. Provides simple abstraction to separate the URI mutation logic. The default implemntation
 * {@link SpringMutableUri} uses spring-web library which is otherwise not needed when using gooddata-rest-common ie.
 * only for model classes.
 */
public interface MutableUri {

    /**
     * Copies this instance.
     * @return copy this instance
     */
    MutableUri copy();

    /**
     * Replaces the query param of given name with given values.
     *
     * @param name query param name
     * @param values query param values
     */
    void replaceQueryParam(final String name, final Object... values);

    /**
     * Replaces the query params.
     *
     * @param params query params to replace
     */
    void replaceQueryParams(final MultiValueMap params);

    /**
     * URI created from current state of this instance.
     * @return uri
     */
    URI toUri();

    /**
     * String representation of URI created from current state of this instance.
     * @return uri as string
     */
    String toUriString();
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy