io.getstream.core.options.RankingVars Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of stream-java Show documentation
Show all versions of stream-java Show documentation
Stream Feeds Java Client for backend and android integrations
package io.getstream.core.options;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.getstream.core.http.Request;
import java8.util.concurrent.CompletionException;
import java.io.IOException;
import java.util.Map;
public final class RankingVars implements RequestOption{
private final String rankingVarsJSON;
public RankingVars(Map externalVars) {
String rankingVarsJSON;
try {
ObjectMapper objectMapper = new ObjectMapper();
rankingVarsJSON = objectMapper.writeValueAsString(externalVars);
}
catch (IOException e){
throw new CompletionException(e);
}
this.rankingVarsJSON = rankingVarsJSON;
}
public String getRankingVars() {
return rankingVarsJSON;
}
@Override
public void apply(Request.Builder builder) {
builder.addQueryParameter("ranking_vars", rankingVarsJSON);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy