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

io.getstream.core.options.CustomQueryParameter Maven / Gradle / Ivy

There is a newer version: 3.15.0
Show newest version
package io.getstream.core.options;

import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;

import io.getstream.core.http.Request;

public final class CustomQueryParameter implements RequestOption {
  private final String name;
  private final String value;

  public CustomQueryParameter(String name, String value) {
    checkNotNull(name, "Missing query parameter name");
    checkNotNull(value, "Missing query parameter value");
    checkArgument(!name.isEmpty(), "Query parameter name can't be empty");

    this.name = name;
    this.value = value;
  }

  public String getName() {
    return name;
  }

  public String getValue() {
    return value;
  }

  @Override
  public void apply(Request.Builder builder) {
    builder.addQueryParameter(name, value);
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy